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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
pawe84
Creator
Creator

How to iterate through a Date table?

Hi everyone,
I have two tables, sales lines and item execption (see below).

Now I want to compre if an item from sales line is in exception table and if the posting date is between valid_from and valid_to. I used a tmap and did a look up from sales table item_no to exception table item_no.

Then I created a flag where I compared the interval at the output side.

row1.item_no != null &&
((TalendDate.compareDate(row1.posting_date , row2.valid_from) ==1 || TalendDate.compareDate(row1.posting_date , row2.valid_to) ==0) &&

(TalendDate.compareDate(row1.posting_date , row2.valid_to) == -1 || TalendDate.compareDate(row1.posting_date , row2.valid_to) ==0)) ? 1 : 0

My issue now: sales0003, item abc, output = 0 but must be 1.

I already checked the Lookup Model in item exception = load for every line, Match Model = all

 

Why the output is still 0 for sales line? It seems that always the first record of lookup table is checked.

How I can solve this issue?

pawe84_0-1753878794900.png

 

pawe84_1-1753878803627.png

Thanks for any hints.

 

Labels (1)
  • v8.x

1 Solution

Accepted Solutions
pawe84
Creator
Creator
Author

Now I got the solution. You have to add after tmap the component taggregate and aggregate the flag to max(flag) then you'll get for n-input lines the exact n-output lines and the flag value is shown correctly.

View solution in original post

1 Reply
pawe84
Creator
Creator
Author

Now I got the solution. You have to add after tmap the component taggregate and aggregate the flag to max(flag) then you'll get for n-input lines the exact n-output lines and the flag value is shown correctly.