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: 
ragosu66
Contributor III
Contributor III

Sum of If with calculated value

I need your help to find a solution to the next issue. I am trying to write a nested if statement with calculated value condition:

Sum( If((Closed_Timestamp - Max({<Display_Name = {'Assignee'}>} Modified_Time)) > ((1/24/60) * TTF), 1, 0)

I tried different solutions to sum them, but anything seems to work when I saw Total row.

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can't nest aggregation functions like Max and Sum without using the Aggr function.

But perhaps you want to use the value of Max({<Display_Name = {'Assignee'}>} Modified_Time) that's calculated at the document level instead of in the context of a charts dimensions. In that case try

Sum( If((Closed_Timestamp - $(=Max({<Display_Name = {'Assignee'}>} Modified_Time)) ) > ((1/24/60) * TTF), 1, 0)


Other wise you'll have to use the aggr function and specify over which dimensions the max should be calculated.


Sum( If((Closed_Timestamp - aggr(Max({<Display_Name = {'Assignee'}>} Modified_Time),DimA,DimB,...DimX) ) > ((1/24/60) * TTF), 1, 0)


talk is cheap, supply exceeds demand
ragosu66
Contributor III
Contributor III
Author

Thanks Gysbert

Your sample was the clue to find the correct code.