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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aggr with set analysis

Hi,

I'm using an aggr function to sum up my sales. Is it possible to combine it with set analysis so that it doesn't matter
what's selected?

Thanks

10 Replies
Not applicable
Author

Would this work for you? sum({1}field) This would disregard all selections providing they are not a dimension in your chart.

Regards

stephencredmond
Partner - Specialist II
Partner - Specialist II

Yes, you can have a set in pretty much any expression, so it will work in Aggr:

max(aggr(Sum({ < SetField = {"value"} > } SalesValue, Country)))

Stephen

Not applicable
Author

Thanks Stephen,

unfortunatley I'm still having problems. I'm trying to see the max sales of (all) customers in Max Sales, in this case the value should

be 50.000, no matter what's selected.

I tried Max Sum Sales: max(aggr(Sum({ < Customer_ID = > } Sales, Customer_ID)))

should look like:

Customer ID Sum Sales Max Sum Sales Max Sales

1 10.000 50.000 60.000

2 35.000 50.000 60.000

3 10.000 50.000 60.000

4 40.000 50.000 60.000

5 60.000 50.000 60.000

Thanks

Not applicable
Author

I think you mean the max sales of all customers should be 60.000. Why do you want to use "Set Analysis"?

Try max(total aggr(Sum(Sales), Customer_ID)) ...

Not applicable
Author

There should be no changing in the max value (60.000) when selection a customer_id.

I thouhgt I could handle thos with Set Analysis.

Not applicable
Author

Ah ok, now i understand.The "max-value" should be independent to every filter.

In this case i would fix the values in the script when reloading the data.

stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

You need to put the set in both the Sum and the Aggr:



max

({<Customer_ID=>} total aggr(Sum({<Customer_ID=>} Sales), Customer_ID))

Stephen

Not applicable
Author

Hi Stephen,

in this case I only get values as long as I don't select a certain customer_id. In case of selecting a customer calculation is "-"

Not applicable
Author

It seems to me the Stephen's solution is good, also when I select a customer.

Try the equivalent

max



({1} total aggr(Sum({<Customer_ID={*}>} Sales), Customer_ID)) .



Roberta