Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression help

hi all,

i have a field (industry) which has 4 values. i have a chart which shows a list of companies with the industries and a sales amount. i only want to show the higest sales amount per industry.

can anyone help please?

3 Replies
erichshiino
Partner - Master
Partner - Master

Hi,

I imagined two solutions:

1) In the chart use properties->dimension limits to keep only the best company of each industry

2) use aggr to calculate, for each industry the max value ( or best company).

I implemented both in the attachment.

Hope it helps,

Erich

Not applicable
Author

hi, thanks for your reply.

I am using v 10 so i dont have dimension limits. so i need to use an expression.

I have tried the expression but it is giving me the highest value per industry but it is not assigning the higest value to the correct customer.

i am using

max(aggr(sum(Value), Industry,Customer))

This gives me each value per industry per customer.

I want to only show the higest per industry but showing the correct customer who had the highest value.

rlp
Creator
Creator

You should use Set Analysis i.e. replace your expression Customer with:

     aggr(

          Only( {$<customer={"= rank(sum(Value))=1"}>} Customer)

          ,

          Industry

     )

the aggr( Industry) is necessary so that the Set_Analysis-selected custommer depends of the value of Industry