Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
orital81
Partner
Partner

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
Partner
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

View solution in original post

rwunderlich

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
Partner
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

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