Qlik Community

QlikView Documents

Documents for QlikView related information.

Custom sort order in chart

Partner
Partner

Custom sort order in chart

This app simulates how the sort order in a chart can be governed by a user option.

Recognised use cases for custom sort orders in charts include:

1. Managing the sort order of charts through chart properties without need for script change and refresh

2. User customisable sort order of dimension values (self service propositions)

3. Setting priority sort orders for subset of dimension values whilst retaining freedom to sort non-priority items by other logic

4. Varying sort order according to audience (e.g. multi-customer applications, where logged in customer wants to see their performance consistently presented at the top / first)

Labels (1)
Attachments
Comments
MVP
MVP

Thanks for sharing

0 Likes

Nice one Jonas..

0 Likes
Luminary
Luminary

Looks good Jonas, this was exactly what I was looking for. I'm was a bit concerned that you have copyrighted it. Can you let me know if I am able to use this expression in my applications without recourse?

Many thanks

Richard

Partner
Partner

Hi Richard,

No worries - just don't take the actual qvw I've produced and sell it on as training please, that is what the copyright is there to prevent.

The syntax tips and learnings are free for everyone to reuse / enrich / repurpose any way they like - I intend to share a lot more like this future wise. Any reference back to the author of particularly useful nuggets is of course appreciated but not mandatory.

Happy implementing!

Regards

Jonas

Jonas Valleskog

Senior Consultant

Mob: +44 (0)7446 144 572

Tel: +44 (0) 208 100 6515

www.contextbi.com

Context Business Intelligence Ltd

Parkshot House, 5, Kew Road, Richmond, Surrey, United Kingdom, TW9 2PR

0 Likes
Luminary
Luminary

Phew...

Here's a couple more examples of changing chart "sort" orders, these work with expressions:

http://community.qlik.com/docs/DOC-6223

http://community.qlik.com/docs/DOC-6046

Thanks

0 Likes
Partner
Partner

I think these would be more efficient and easy to understand sort expressions for the two charts, respectively:

If(Customer='$(vFocusCustomer)', 0, 1)

If(Customer='$(vFocusCustomer)', 0, Rank(Sum(Value)))

0 Likes
Partner
Partner

Hi Michael,

In my simplistic example of comparison against a single value, I agree with you - match(...) is over-engineered. With minor tweaks, match(...) allows for setting priority sort for a bundle of values whereby you may have three focus products or competitor brands that you wish to prioritise, not just the one.

Thanks for the feedback, simplification where possible is always good - a hunch tells me your version will more often than not be sufficient to meet client needs.

0 Likes
joydipp1988
Contributor

Jonas Valleskog The example is very useful. Thanks for sharing.

0 Likes
ahaahaaha
Honored Contributor

Good info. Thanks for sharing.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2014-04-29 07:41 PM
Updated by: