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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reject data from xml

Hello all,

I have trouble to filter data in a job in talend TOS DI 6.2.1.

The purpose of the job is to load and transform an xml file containing one (or more) invoice. The first layers of the tree contain the header, then the deepest contain the invoice lines. Ex:

0683p000009Lumk.png

Everything worked well until I need to reject the whole invoice (not just the lines) if all of "fiscal_period" fields (invoice lines) of an invoice do not have the same value, Ex:

Invoice number = 12193624860002852

If line in field "fiscal_period" not equals to prévious "fiscal_period" then reject invoice and send this reject to a file.

 

Currently I have created a global variable and a tMemorizeRows that allows me to identify when the "fiscal_period" is different from "fiscal_period" previous line.
Then with a tjava_row I set the variable to true or false, finally with a t_filterrow I reject and send to Excel log errors file.

Problem is: the lines are rejected but not the entire invoice.

Does anyone have an idea for a solution?

Thanks,

Oliver.

 

PS: My Job looks like this:
0683p000009Luit.png

 

 

 

Labels (4)
1 Reply
vapukov
Master II
Master II

as idea, may be not fasted, but it will work

 

1) make list of invoices in file (extract uniqueid from XML)

2) iterate over list - XML path for single uniqueid as TOP level

3) extract fiscal period from all parts -> make list unique -> count number

4) IF(runIf trigger)  number more than 1 - reject

5) IF number = 1 - continue Job