Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Order alphabetically with a expression

Hi

I have a field called %OrderType, which has values KG or Box. What I want is that when the user select KG or Box, a dimension of a graph is orderer by an expression. This is working. But if there is no expression selected, I want the dimension to be ordered alphabetically.

The dimension is "Especie" and this is the expression that I am using:

=if(%OrderType='KG',Sum(#Kg)/1000,

  if(%OrderType='Box',Sum(#Box)/1000,

    [Especie])))

Any idea about how to order alphabetically is nothing is selected?

Thanks!

1 Solution

Accepted Solutions
cristian_av
Creator III
Creator III
Author

I've found an easier way:

=if(%OrderType='KG',Sum(#Kg)/1000,

  if(%OrderType='Box',Sum(#Box)/1000,

    null() )))

And select the order alphabetically in the GUI

Thanks!

View solution in original post

2 Replies
sunny_talwar

May be this

=If(%OrderType = 'KG',Sum(#Kg)/1000, If(%OrderType = 'Box', Sum(#Box)/1000, (Count(DISTINCT [Especie]) - Rank([Especie]))))

cristian_av
Creator III
Creator III
Author

I've found an easier way:

=if(%OrderType='KG',Sum(#Kg)/1000,

  if(%OrderType='Box',Sum(#Box)/1000,

    null() )))

And select the order alphabetically in the GUI

Thanks!