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

Ignore Time selection in aggr function

Hi,

A bit of a brain freeze over here.

I need the below expression to ignore the time selection. Where do i put the

{ $ <Time60 = > }   or similar?

SUM(Aggr(IF(SettlementOrder= (MIN(TOTAL <DateSettlementOrder)), Sum(Balance)), Date, SettlementOrder)) 

Thanks in advance,

Olle

7 Replies
JonnyPoole
Employee
Employee

Put it in ALL chart aggregation functions  (in this case sum() and min()  ) . Assuming all other syntax is accurate...

change:

SUM(Aggr(IF(SettlementOrder= (MIN(TOTAL <DateSettlementOrder)), Sum(Balance)), Date, SettlementOrder))


to:

SUM{ $ <Time60 = > }  Aggr(IF(SettlementOrder= (MIN( { $ <Time60 = > } TOTAL <DateSettlementOrder)), Sum( { $ <Time60 = > } Balance)), Date, SettlementOrder))

Not applicable
Author

Hi Jonathan,

yes the original works fine.

I tried your tweak but only receiving zero-values

Kind Regardfs,

Olle

MK_QSL
MVP
MVP

Provide your sample data or apps

JonnyPoole
Employee
Employee

If you can't share the QVW i would try breaking apart the expression and putting those parts in new expressions. 

Start with these:

MIN( { $ <Time60 = > } TOTAL <DateSettlementOrder))

Sum( { $ <Time60 = > } Balance)

and then add start to wrap in the rest of it...

IF(SettlementOrder= (MIN( { $ <Time60 = > } TOTAL <DateSettlementOrder)), Sum( { $ <Time60 = > } Balance))

post which part is failing...

Not applicable
Author

Solved my problem using the FirstSortedValue function instead, but thanks for your help!

Kind REgards,

Olle

Not applicable
Author

Actually the two of them works perfect when used separately.

But when I put them together I receive null values.

JonnyPoole
Employee
Employee

hi -  i wasn't 100% sure on the feedback.  I think you mentioned that both the Sum() and the Min( TOTAL <Date> ) work as seperate expressions with the SET ANALYSIS statement but no when you do the If ().

If that is the case you could try wrapping SettlementOrder in the Only() function and putting the SET statement in there too... but i'm not 100% it will work.  Really need to see a sample QVW

IF(  Only({ $ <Time60 = > }  SettlementOrder) = (MIN( { $ <Time60 = > } TOTAL <DateSettlementOrder)), Sum( { $ <Time60 = > } Balance))