Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max and interval in script

Hi,

I have data like the following:

Table1:

Id
Seg
1
260
1
144
1
555
2
628
2
953
2
876
2
212
3
142
3
523
4
189
4
634
4
988
4
755

I need to achieve the following result (in the script):

Table2:

Id
Final Seg
1
144
2
953
3
142
4
988

Where "Final Seg" =
for each Id
if one of the values (Seg) is in the interval [140 - 146] then
finalSeg = Seg
else // no Seg value in the interval
finalSeg = the max Seg value (for this Id)
end
end

Thanks.



2 Replies
Not applicable
Author

Hi,

Please find the attached application as per your requirment.

Regards,

Sridhar Chitikela

Not applicable
Author

Hi,

The solution was published at: http://community.qlik.com/forums/t/22794.aspx

Best regards.