IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: mbaile
About
User Name: mbaile
Forum Rank: Newbie
Real Name:
Location USA
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Monday, January 29, 2018
Last Visit: Thursday, December 6, 2018 2:37:44 PM
Number of Posts: 5
[0.03% of all post / 0.02 posts per day]
Avatar
Last 10 Posts
Topic: Using one value UNLESS you see another value,then use that?
Posted: Thursday, December 6, 2018 2:37:44 PM
That makes sense, thanks for the clarification. In the 27 sample orders provided to us, there are many that have multiple D1's (order lines) in some of the orders, but in the case where a D3 has been provided, we only have one D1 line. This is good as the ISBN in the D1 corresponds to the title from the D3. Even though there are only one of each, I still can't pull the title so I'll have to get the filter logic together to pull that data. This will be even more important if we ever get a file with multiple D1's and multiple D3's as we'll have to link them together somehow (I'll also confirm with our customer if this will ever happen).

Looking at the file, I'm not sure what to filter on and don't see anything that corresponds between the D1 and D3 elements...I thought something like that would be simple..shows what I know!

Thanks again for all of your help, much appreciated.
Topic: Using one value UNLESS you see another value,then use that?
Posted: Wednesday, December 5, 2018 6:22:07 PM
Brilliant...I struggled with that for hours and hours. Thank you!

I'm stuck on one last piece that I was hoping to figure out on my own, but I think there may be some conflict going on. Aside from the information that I mentioned earlier, I also have some other some other data which I've sampled below. Each time we see an H1, this signifies a new order. Each H1 will have at least one H2 and one D1. We could have two or three H2 values and multiple D1 values. The H2 values are address variants and the D1 values are products. Occassiaionlly, we'll also have a D3 entry. If we see the D3 value, then we want to pass along some data from within this field. For some reason, I'm not able to pull data out of this D3 and into where I want to.

I'm specifically looking at the order on lines 95-99. This is the 19th order in the file. I can map this to one area of the end xml file, but not to others. I've attached my files and mapping. Is there some reason that I can map the title field to one place in the file, but not another?



H1
H2
D1

H1
H2
D1

H1
H2
H2
D1
D3

On a side note, I used your earlier logic a little differently since I had all the fields already there, so I just added in the exists logic and drew my connections, it's working great!
Topic: Using one value UNLESS you see another value,then use that?
Posted: Wednesday, December 5, 2018 2:12:02 PM
I'm working with a flat file that has orders separated by a header line. I have the order separation working, but within each order I have an H2 line with address information. In all cases, I'll have one with a type of ST like this:

H2 ST ADD1 ADD2 ADD3 CITY STATE ZIP COUNTRY

In some cases, I'll have an address type of CS in addition to this:

H2 ST ADD1 ADD2 ADD3 CITY STATE ZIP COUNTRY
H2 CS ADD1 ADD2 ADD3 CITY STATE ZIP COUNTRY


What i need to do is say: "If you have an H2 with a type of CS, then use the address information from that line. Else, use the address information from the ST line".

Topic: Removing Leading Zero's
Posted: Wednesday, December 5, 2018 1:59:40 PM
That's perfect, thank you!
Topic: Removing Leading Zero's
Posted: Tuesday, December 4, 2018 9:38:43 PM
I'm trying to remove leading 0's at the beginning of a string. I found this post: https://www.altova.com/forum/default.aspx?g=posts&t=7 , but I can't seem to get it to work.

My function itself and what I have in the mapping look to just be the same which is likely why it's not working, but I cannot figure this one out. I'm sure it's something simple, but any input is appreciated. The first picture is the function itself, and the second is the function within the mapping.




Use of the Altova User Forum(s) is governed by the Altova Terms of Use.