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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jacek_k
Contributor III
Contributor III

Calucate sum with specific condition

Sample data:

LOAD * INLINE [
date, index, value
1.01.2022, a, 100
1.01.2022, b, 50
2.02.2022, b, 100
];

 

I want to calculate sum(value) but
if index = a and index = b per exist same day sum only index = a (a have more priority, ignore b)
But if b only exist per same day sum(value) if index = b if only index a exist sum(value)

I need script flag to use it in set analysis. 


Labels (1)
11 Replies
jacek_k
Contributor III
Contributor III
Author

Your solution is perfect but requaire value column, what happend if I have more value column or I don`t want use value to find flag?

jacek_k
Contributor III
Contributor III
Author

Hi, could you be so kind and reply to my last question?