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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
sarafamiglietti
Creator
Creator

Table : Keep only lines with min value

Hello,

I have this table :

Capture.JPG

And I want to keep in this table only the first line where CA is bigger than Costs for each week (ie yellow lines).

Expected Table :

Capture2.JPG

Please see attached qlikview document.

I tried with min(), aggr(), firstsortedvalue() functions but I did not manage to get the good results.

Can someone helps me?

Thanks in advance.

Regards

Sara

12 Replies
sarafamiglietti
Creator
Creator
Author

Hello,

I'm sorry.

I thought my example would suffice but it seems to be a little bit more complicated

It's very hard to explain my problem and I cant provide you my complete Qlikview document.

Finally, I have downloaded Qlikview 12.

What would be the formula to use with the new aggr function?

Thanks and regards

sunny_talwar

Try this

Min(Aggr(if(RangeSum(Above(sum(ca),0,rowno()))>RangeSum(Above(sum(costs),0,rowno())),(delay)), week, (delay, (NUMERIC))))

sarafamiglietti
Creator
Creator
Author

Great! It works!

Thanks a lot!!!!