Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QV - Stacked bar chart custom order

Hello, i have a stacked bar chart where i display bugs and each "stack" is for different sort of bugs. But i can display them only alphabetically asc or desc so - Trivial, Minor, Major, Critical, Blocker   or Blocker, Critical, Major, Minor, Trivial. Bud i don´t want alphabetical order i want it based on the priority so Blocker, Trivial, Minor, Major, Critical. How to do that plsy?

3 Replies
Anonymous
Not applicable
Author

You can sort by expression and use this:

Pick(Match([Bug Type], 'Blocker', 'Trivial', 'Minor', 'Major', 'Critical'), 1, 2, 3, 4, 5)

MarcoWedel

Hi,

one solution could be:

QlikCommunity_Thread_207017_Pic1.JPG

QlikCommunity_Thread_207017_Pic2.JPG

tapPrio:

LOAD *, RecNo() as prioNum

Inline [

priority

Blocker

Trivial

Minor

Major

Critical

];

tabBugs:

LOAD RecNo() as BugID,

    Pick(Ceil(Rand()*5),'Blocker', 'Trivial', 'Minor', 'Major', 'Critical') as priority,

    Date(Today()-Ceil(1000*Rand())) as [report date]

AutoGenerate 30;

hope this helps

regards

Marco

johnw
Champion III
Champion III

I typically will do something like this in my script before the main load:

[Bug Type Order]:
LOAD * INLINE [
Bug Type
Blocker
Trivial
Minor
Major
Critical
];

Do your main load, then:

DROP TABLE [Bug Type Order];

Then in the chart, sort by load order. I don't like fiddling with sort expressions in charts, or having an extra table lying around complicating my table model.

Edit: modified MarcoWedel's example to demonstrate