Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
aashish_21nov
Creator
Creator

Read first/last row of XML

How to read first and last row of XML file.

 

 

Thanks in advance

 

Labels (3)
6 Replies
Anonymous
Not applicable

Hi,

 

     While reading the file, you can pass the ((Integer)globalMap.get("tFileInputXML_1_NB_LINE")) parameter also to the subsequent data flow and use this value to pick the first and last rows.

 

Warm Regards,

 

Nikhil Thampi

aashish_21nov
Creator
Creator
Author

where should I pass NB_LINE

aashish_21nov
Creator
Creator
Author

or is there any way to read a file in reverse order like the last record then second last and so on.

Anonymous
Not applicable

Hi,

 

     My sincere apologies as I read the requirement slightly different way. If you want to read the line numbers for each column, the best way is to add a sequence and transfer the data to an additional line number column.

 

     I have shown it for a delimited file but the theory remains same for xml file also.

0683p000009Lyuo.png

 

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable

Hi,

 

     Once you got the line numbers for each row, you can choose the data in any order using a tsortrow and tfilterrow components.

 

Warm Regards,

 

Nikhil Thampi

aashish_21nov
Creator
Creator
Author

actually, we are just finding the shortest/smartest way to validate XML files.