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 in Trellis chart

Hi all,

I'm having some problem sorting the bars in a trellis chart. I want to sort it by the expression value. But it doesn't seems to work.

trellis.png

Any work around for this one?

6 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

I thing, it sort right, it sorts now descending in SUM of All values, not only one chart by its own.

Not applicable
Author

Sorry if my question is not clear. But how can I sort the chart based on the 2nd dimension in trellis? (international & domestic)

erichshiino
Partner - Master
Partner - Master

I'm not sure I got your question right...

I also think this result is right. You got international first because in total (it seems to be) larger.

You got 'Better Large...' as the first product because the total result makes it the top product.

I think you would like to see 'Red Spade' as the first product for 'Domestic' but the product sorting criteria is independent of the type (international or domestic). I believe this help you compare the results between the dimensions on the trellis.

Not applicable
Author

Yup... I want Red Spade as the first product for Domestic... this is because I want to create a top 5 Item for each region. So, no work around for this one?

erichshiino
Partner - Master
Partner - Master

I'd say the work around would be the creation of two charts. Each one locked to one region by set analysis.

Then,

The expression of the first would be (I don't know the name of your fields, ok)

SUM { <Region = {International}>  Sales}

and

SUM { <Region = {Domestic}>  Sales}

hdonald
Creator
Creator

Hi,

There might be a way to do this in one Trellis chart depending on how you are calculating your Top 5 - if you can have your Top 5 Rank number as the secondary dimension in the Trellis.

If you also added an expression containing the Item Name (no bar ticked - only 'Values on Data Points') then the rank number would sort the items in the order you want and the extra expression would display the Item name for each bar (you could also tick 'Plot Values inside segments')

If the Rank has to be calculated then add a calculated dimension something like

=if(aggr(rank(sum(Sales)),Origin,Item)<=5,

     aggr(rank(sum(Sales)),Origin,Item) )can

Otherwise if you have the Rank Number as a dimension from the script maybe Dual() can be used to sort by a Rank number but display an Item name.

If you post an example doc I'm sure others will contribute more suggestions,

Regards,

HD