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: 
Anonymous
Not applicable

Aggr max sales date with condition

I have table with sales, divided by sales points.

in first expression i calculate max date, where sales > 0

max({<[Quantity]={">0"}>}Date)

in second expression i calculate sales with date, where sales > 0

sum({<Data={"$(=max({<[Quantity]={'>0'}>}TOTAL <SPoint> Data))"} >}[Quantity])

but in the second expression filter {<Data={"$(=max({<[Quantity]={'>0'}>}TOTAL <SPoint> Data))"} >} is not aggregated by Spoints, it's the same for all of them.

The necessary result for me:

Sales for point 6 with 21.07.2014

Sales for point 8 with 21.07.2014

Sales for point 12 with 18.07.2014

See attached file.

Thank you!

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

first of all , set analysis won't work for you ,

the reason is that set analysis always return the same value to all rows in the chart , because set analysis defines a selection in the data model  and as with all selections they effect all data the same

attach is an example using firstsortedvalue hope , it will help you

View solution in original post

13 Replies
Anonymous
Not applicable
Author

Date instead Data in second expr.

Not applicable
Author

Hi,

Is this the same way u want to get desire output,


PFA



aveeeeeee7en
Specialist III
Specialist III

To pick the Max Date try something like this:

SUM({<DateField={'$(=Max(DateField))'}>}Quantity)

Regards

Aviral Nag

Anonymous
Not applicable
Author

ok.

in your example:

in first expr you're calculating max date, where quantity > 0 , yes ?

in second expr you're aggregating quantity by sales points, but without date condition from previous expr.

in second expr i need to get quantity, connected with max date, where sales >0

Thank you!

Anonymous
Not applicable
Author

this expr is useful, but not full correct for me.

i need to get not only the quantity with max date.

max date must be such, where quantity > 0

thank you!

Not applicable
Author

You can mention in exp as,

aggr(sum({<[Quantity]={">0"}>}Quantity),Spoint)



Anonymous
Not applicable
Author

Thank you.

But this expression get me aggregated quantity > 0 for all period, but i need the same, but for max date, where quantity > 0

aveeeeeee7en
Specialist III
Specialist III

Try this:

sum({<DateField={'$(=Max(DateField))'},Quantity={">0"}>}Quantity)

sasikanth
Master
Master

try some thing like below

SUM({<DateField={'$(=Max(DateField))'}>} if(Quantity>0,Quantity))