Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
SMR040
Contributor III
Contributor III

Data Mapper (tHMap) - get the next value in loop based on date filter

Hi Community,

 

While the requirement seems simple I have not yet found the complete solution.

 

What I am trying to achieve is the following:

As an input i have 0:* where a block with information is processed, this block also contains a due_date. As an output i also have a block with 0:* (also tried 0:1) where i want to get the upcoming due_date.

 

For example: (YYYY-MM-dd)

input due_date = 2022-11-30 -- this one should not be shown because it is already passed

input due_date = 2022-12-30 -- this one should be shown because today is 2022-12-08

input due_date = 2023-01-30 -- this one should NOT be shown because i only want the NEXT single block, not ALL upcoming blocks.

 

what i have done so far is in the SimpleLoop --> Filter i have a 'Lesser' to check if current date is smaller than the date in the input and this logic works fine because i always get the NEXT date. but the problem seems to be that i cannot limit that result into only 1 occurrence which is the nearest to today. i always get ALL the blocks in the future.

 

0695b00000aEzJGAA0.png 

the above validation i have put it in the Validate tab, but when i had it on (0:*) i had it in the SimpleLoop --> Filter.

 

My output is like this:

0695b00000aEzDTAA0.png 

Now my question is how can i limit the loop to show only the first block. I know there is a FixedLoop component but I cannot seem to combine that with the logic to check the date since the FixedLoop function does not have a filter.

 

Thanks in advance

Labels (4)
1 Reply
SMR040
Contributor III
Contributor III
Author

Also one extra note: I have also tried with the IndexRangeLoop but since the index always is different i can't use a fixed value in the start index. I have tried to do something like LoopIndex function to get the current index but that is not allowed..