Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sorting bar graph

Hi all,

i have a bar graph with dimension as 'category' which includes Diamond, Platinum, Gold, Silver and Others

how do i sort them in same order

thanks in advance

9 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Hi Deepak,

You can use the Load Order for sorting or you can use the Match function.

Check this video from my blog post:

http://qlikshare.com/622/

I hope this helps!

Cheers,

DV

MK_QSL
MVP
MVP

Load * Inline

[

  category, SortOrder

  Diamond, 1

  Platinum, 2

  Gold, 3

  Silver, 4

  Others, 5

];

Create above Inline Table and go to sort table and add below in expression... Now sort by numeric ascending order

SortOrder



Or 2nd Method:

You can simply write below expression in your sort tab...


=Pick(Match(category,'Diamond','Platinum','Gold','Silver','Others'),1,2,3,4,5)

ajaykumar1
Creator III
Creator III

Manish Right applying the inline more easy and you can play some options in the sort tab itself.

Regards,

Ajay

qlikoqlik
Creator
Creator

Hi

or you can use an expression using match function in the sort tab

Thanks

Padma

Colin-Albert

If you load the categories as a DUAL value, the categories will sort automatically.

Dual(text value, numeric value)        - Dual displays the text values but sorts by the numeric values.

Add this to your load script

Load

    dual(Category, Pick(Match(Category, 'Diamond', 'Platinum', 'Gold', 'Silver', 'Others') ,1,2,3,4,5 )) as Category,

     < the rest of your load script>

Not applicable
Author

hi Manish,

I tried the 2nd Method but it didnt work

MK_QSL
MVP
MVP

Check enclosed document...

Not applicable
Author

???

Colin-Albert

You will have to wait until the moderators release the attachment before you can see it.