Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

How to manipulate a stacked bar chart (with two expression) , in a way that expression with greater value should be on top in bar ?

Hi All ,

I need to manipulate a stacked bar chart (with two expression) , in a way that expression with greater value should be on top in bar .

Bar chart manipulation2.JPG

As we see in above pic sales value for Marseille = 49711.3 which is lesser than its Deficit , while sale value for Avignon is greater than its Deficit .

My requirement is if the sale value is more then it should top in stacked bar else bottom , Which means for Avignon sales(blue colour)  should be on top of bar and Deficit (red) should in bottom . But by default Deficit is in top while Sales is at bottom .

Thanks & Regards

Shekar

1 Solution

Accepted Solutions
sunny_talwar

The attached is without dimension limits... we can introduce top 20 using Rank function... if it looks like something you want

Capture.PNG

View solution in original post

7 Replies
sunny_talwar

You are looking to get this in combination of the dimension limits?

shekhar_analyti
Specialist
Specialist
Author

It should work irrespective of dimension limit . ..

sunny_talwar

The attached is without dimension limits... we can introduce top 20 using Rank function... if it looks like something you want

Capture.PNG

shekhar_analyti
Specialist
Specialist
Author

Please explain :

Pick(ValueList(1, 2), RangeMin(Sum(SALES), Sum(DEFICIT)), RangeMax(Sum(SALES), Sum(DEFICIT)))

sunny_talwar

Instead of using two expressions, I created a dimension using ValueList... but it seems that we don't really need it... we might be able to replicate this without ValueList also....

RangeMin and RangeMax are just used to determine what comes at top and what comes at the bottom

sunny_talwar

Attaching the app with two expressions and 1 dimension

shekhar_analyti
Specialist
Specialist
Author

Thank you Sunny Bhai !!