Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
orital81
Partner - Creator III
Partner - Creator III

Bar Chart 2 Dimentions sorting

Hi all

I would like to sort a bar chart by period and by customer.

Meaning that small customers will be on top of the big every period.

For example : in the screenshot below, Customer B (Yellow) will be below A in 2008

test1.JPG

qvw file attached.

Thanks for your help

Ori

1 Solution

Accepted Solutions
Gysbert_Wassenaar

With some messing about it can be done. See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
sujeetsingh
Master III
Master III

Hi,

i diged much but finally giving you a thread with similar issue may it help you..

http://community.qlik.com/message/244397#244397

http://community.qlik.com/message/53978#53978

orital81
Partner - Creator III
Partner - Creator III
Author

Hi Son Of Sardar, the 2nd link is more relevant but still doesn't promote me to the result.

Thanks anyway

Gysbert_Wassenaar

With some messing about it can be done. See attached qvw.


talk is cheap, supply exceeds demand
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Nice solution Gysbert!

I think you can simplify the color expressions to:

=color(FieldIndex('customer', customer))

If you use a dual() for the calculated dim you can get the Customer name in the pop-up

=aggr(  dual(  only(customer) , sum(amount)   )  ,year,customer)

Ideally, that would work as the legend also and then the seperate legend chart wouldn't be required. But the legend groups by the numeric value -- I couldn't get it to display just the string customer values.

See attached.

-Rob

orital81
Partner - Creator III
Partner - Creator III
Author

Thanks for the quick and accurate answer!

Gysbert_Wassenaar

Actually, I later realized I already had added a color field to the table to link the customers with a color. So I could just have used color([color]) instead.

Thanks for the suggestion about using the dual function. That's a new trick for me with regards to making the popup look nice.


talk is cheap, supply exceeds demand
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

My point on color() was that there was no need for a color field. You can use the naturally occuring FieldIndex() to derive the same value.

-Rob

Gysbert_Wassenaar

Ahaa, I get it now. Cool. Thanks for educating me some more.


talk is cheap, supply exceeds demand