Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Including a sum statement into Firstsorted value

Hello I have a problem. I am getting a null value because there are two records in my table with the same date, which is fine, but Qlikview displays this as a null, I have used expression FirstSortedValue([Cleared Amount],-Date) I would like to use FirstSortedValue(SUM[Cleared Amount]),-Date) but Qlikview doesnt like it, I could do a resident load but the report takes over an hour to reload.

Is is it possible to use sum in a firstsortedvalue statement?

Regards.

Paul.

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Perhaps this:

     FirstSortedValue(Aggr(Sum([Cleared Amount]), Date), -Date)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
swuehl
MVP
MVP

You can't embed an aggregation function (sum()) into another (FirstSortedValue() ) without using advanced aggregation, so try something like

=FirstSortedValue( aggr(sum([Cleared Amount]),Date), -Date)

Or if you don't want to aggregate your Amounts because they are just duplicates, try DISTINCT qualifier:

=FirstSortedValue(DISTINCT [Cleared Amount], -Date)

Not applicable
Author

Unfortunately that didn't work, Still got a null value,

Paul.

swuehl
MVP
MVP

Are you trying to use the expression in script or in a chart expression?

Not applicable
Author

Normal expression Swuehl, I am trying to sum to value amounts (off different rows) that have the same date.

Paul.

sidjustice
Contributor II
Contributor II

Did you ever find an answer to this issue? I am having the same issue and would appreciate if you could share your solution