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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr Function with If Statement

Good morning,

I am having difficulties with 1 formula.

It works perfectly on a Table but when I try to put it on a KPI object, the function does not work.

The formula is the following:

if(Max({<QTYCONSUMED={"<0"}>}[MONTH ORDER])>=(vOPENBAL-12),sum(Amount))

Any idea on how to solve this issue ?

Thanks for your help,

Tanguy

10 Replies
Not applicable
Author

Thanks a lot it really helped :

The correct formula was :

Sum(

{<[MONTH FULL NAME]=>}

AGGR(if(Max({<QTYCONSUMED={"<0"},[MONTH FULL NAME]=>}[MONTH ORDER])>=(vOPENBAL-12),

Sum({<[MONTH ORDER]={"<=$(vOPENBAL)"},[MONTH FULL NAME]=,STOCKITEMCODE={"<>MANUALADJ"},[CREATION DATE]={"<=$(=Date(Today()-360))"}>}Amount))

,STOCKITEMCODE))