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

Dynamic Sort of bar chart in qlik view

Hi team,

my requirement is , dynamic sorting in bar charts. like high to low (and) low to high (and) Alphabetic order. Which should given to user after development of chart.

User should able to sort the chart.

thank in advance.

jlpashfaq_haseebaesloveisfail

6 Replies
sarvesh
Creator III
Creator III

Hi - i did get this to work.

1. Build a 2 row (or more) data island table in the data model with each row determining a 'format code'

Format:

load

  if(RowNo()=1,'Percentage','Integer') as Format

AutoGenerate 2;  

2. Build a variable to determine the numeric format based on the selection:

set vFormat='if(Only(Format)=' & chr(39) & 'Integer' & chr(39) &',' &chr(39)& '#,##0' & chr(39) & ',' & chr(39) & '#,##0%' & chr(39) & ')';

3. Invoke the variable in the 2nd argument of the num() function to dynamically determine the format.

change measure expression from:

sum(Sales)

to:

num( sum(Sales), $(= chr(39) & $(=$(vFormat)) & chr(39)) )

and leave format to 'auto

Qlik Sense Forums

Please remember to mark this as "helpful" & "correct answer" if your query has been solved.

This will help users identify the answers should they come across this thread in the future.


Regard's

Sarvesh Srivastava

Anil_Babu_Samineni

From User Prospective, I don't think whether we do have option to enable the Sort icon on Dimension prospect

But, You can do from Sort tab what ever you wish

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sasikanth
Master
Master

HI,

If the sorts are based on Dimension (Alphanumeric) and Expression (SUm(sales)). Then

one way is to create a INLINE table and use it in front end with the help of 3 charts .

LOAD * INLINE [

TypeOfSort

Alpha,

ASC

DSC

];

Upon selection of TypeOfSort add an action to set a variable (vSortOrder) and use the same in chart Layout --> conditional Display.

Anonymous
Not applicable
Author

hi sasik,

what u said is correct and we can achieve but no. of sheets are increasing and loading time will increase.

is there any other method?

Anonymous
Not applicable
Author

hi srivastava,

i cant get ur code can u share me the example.

Anonymous
Not applicable
Author

This might help you Veera dynamic sort order for expressions