Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
vandith123
Contributor III
Contributor III

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sasikanth
Specialist III
Specialist III

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.

vandith123
Contributor III
Contributor III
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?

vandith123
Contributor III
Contributor III
Author

hi srivastava,

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

laddu_927
Specialist
Specialist

This might help you Veera dynamic sort order for expressions