Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting issue

Hi,

I have a data set like below.

I want a bar graph and want to limit bars to show only 3 bars with a condition when the gross marging% is higher than 20%.

and secondly i want to sort those bars with an expression - Sum(Revenue).

Gross Margin %(Measurement) - > (Sum(Cost1)+Sum(Cost2)+sum(Cost3))/sum(Revenue)

CustomerName (Dimension) - CustomerName

    

CountryCustomersRevenueCost1Cost2Cost3
IndOrang1004307
RusBharti20005454534
IndRel1001234
RusHP500541135
AmericaOrang234345433335
EMEABharti34237555343
PakRel64576344
BangHP5477343435345
AmericaKelvinator1004543
EMEAwirlpool200068743354
PakOrang1002334
BangBharti5002423223
EMEARel6000464322
MyOrang534543234254
AfganistanBharti45334234
LebanonRel234346
AfganistanHP3454435343111

Regards

Prasanta

23 Replies
swuehl
MVP
MVP

Ok, so what about the sample I've attached to my previous post?

Not applicable
Author

yes, thats working.

But if you check, in you expression we are saying lets say <=3, which means we should have 3 bars.

But in you qvf, its showing 2 bars only.

swuehl
MVP
MVP

Well, that's what you asked for in your first requested chart, right?

You've defined a condition combined of

a) TOP3 Revenue

and

b) Margin > 20%

=Rank(Sum(Revenue))<=3 and (Sum(Cost1+Cost2+Cost3)/Sum(Revenue)>=0.2)"}

From the three TOP3 Revenue customers, only 2 showed margin >20%

This is how I interpreted your requested chart (the one that showed the two bars)

Not applicable
Author

Hi,

can you please check this new one that i created for some more suggestion around.

here is the link.

i am still struggling to fix this issue.

https://community.qlik.com/thread/213942?sr=inbox