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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Lotteverhoeven
Contributor
Contributor

aggregation first sorted values

Hi, I want to make a calculation based on the records in the appendix. 

What I want to do is I want to sum all the amounts in the column SUM_Production_SONO, but only the first record for the unique combination of the field Date, Order Number and Phase. 

 

I already tried formulas like:

Sum(
{<Measure={'Kilo'}>}
Aggr(
If(RowNo() = 1, Sum(Sum_Production_SONO), 0),
Date,
[Order Number],
Phase
)
)

AND

Sum(
{<Measure={'Kilo'}>}
Aggr(
If(RowNo() = 1, Sum(Sum_Production_SONO)),
Date,
[Order Number],
Phase
)
)

 

But they still give the sum of all the values instead of only the first one. Can someone help me with this?
Thank you in advance.

 

Labels (2)
1 Reply
marcus_sommer

Maybe something like this:

if(Date = above(Date) and [Order Number] = above([Order Number]) and Phase = above(Phase),
   null(),
   Sum({<Measure={'Kilo'}>} Sum_Production_SONO))