Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I define the order to show bars from left to right?

Hi all,

I like to accumulate a dimension based on the first expression,  but when I make a bar graph always the first expression is on the left,  however I would like to show the first expression on the right or otherwise I would like to choose what expression to use for accumulate dimensions...

I have this graph:

2016 is an expression and the graph only shows countries representing at least 5%... So... I want to put 2016 on the righ and maintain the color of the bar....

Please help me.

Regards,

Fernando

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think you can do it just like this, using your current chart with the dimension limit and two expressions:

Create a new expression

=column(3)

and promote to the top. 2015 expression should be second and 2016 expression third

Then deselect 'bar' on display options for first expression.

Bar chart sorted.png

You'll see two bars, sorted descending by second bar and also dimension limited by second bar (i.e. first expression)


If you want to keep the colors, set background color attribute expressions for second and third expression:

=color(2)

=color(1)

Bar chart sorted_2.png

Hope this helps,

Stefan

View solution in original post

9 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi Fernando,

can you upload an example QVW that shows the issue?

Andy

Not applicable
Author

Here when you want to put limit QlikView for dafault use the first expression to restrict,  but I would like to choose which expression to use...

To QlikView the first expression is which is on the top....

Not applicable
Author

But if I promote 2015 to the top I will change the condition to resctrict dimention and I don't want to do this... I want to restrict always by 2016's expression..

awhitfield
Partner - Champion
Partner - Champion

In the expression tab, click on the 2015 expression and click promote:

Is this what you mean?

Andy

Not applicable
Author

No it is not... This change condition to restrict the dimention to "2015's expression"...

sacosta5
Contributor III
Contributor III

Hi Fernando...

Maybe You could use match in the dimention Country


match(PAIS, España,Italia,Indonesia, ...)


Silvia

rubenmarin

Hi Fernando, you can switch the expressions order as said above and use another way to limit your dimension, like using a calculated dimension:

=Aggr(If(Sum(Sales)/Sum(TOTAL Sales)>0.05, DimensionField), DimensionField)

// In QV12 in can be done using set analisys in Aggr...but I didn't tested yet

In the 'Colors' tab (or using background expression) you can also set the color of each bar.

swuehl
MVP
MVP

I think you can do it just like this, using your current chart with the dimension limit and two expressions:

Create a new expression

=column(3)

and promote to the top. 2015 expression should be second and 2016 expression third

Then deselect 'bar' on display options for first expression.

Bar chart sorted.png

You'll see two bars, sorted descending by second bar and also dimension limited by second bar (i.e. first expression)


If you want to keep the colors, set background color attribute expressions for second and third expression:

=color(2)

=color(1)

Bar chart sorted_2.png

Hope this helps,

Stefan

Not applicable
Author

Swuehl,

Thank you so much!... This works perfectly!

Regards,

Fernando Toro