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: 
Not applicable

Expression as dimesion

Hi

i want to sort a table using different expression which is based on some other column.

Now i want to limit the Dimension. But it is not possible in Line Chart.

So i tried to put if(rank(expression)<11, Dimension)

But the problem is expression is always calculated over dimension. So the above thing returning Null value when used as Dimension. If i used the same in Expression as if(rank(expression)<11, Dimension) over the Dimension it is returning the correct top values.

Anything can be done to get the Top dimension using Expression without placing it over a dimension?

I explained my problem as simple as i can.

Any ideas ???

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

aggr(if(rank(total expression)<11, Dimension,'Other'),Dimension)

View solution in original post

10 Replies
vgutkovsky
Master II
Master II

You need to use the expression within an aggr()--the dimension of the aggr would be the dimensions you want to recreate.

Regards,

Not applicable
Author

Hi,

It is possible to limit the Dimension in Line Chart.

In Line Chart-Properties-Presentation-Dimension Limitations(Right Top)-Max Visible Number.

Select this number as 10 or whatever you want (<100).

Sort your data based on Expression in Sort options.

Hope it resolves your problem.

Happy Thoughts

Not applicable
Author

nope...aggr() is not working there for me...thats why i raised this question.

vgutkovsky
Master II
Master II

Try this: aggr(if(rank(total expression)<11, Dimension),Dimension). If that doesn't work, please post an example app.

Not applicable
Author

But i want Others label which is not possible in Line chart.

vgutkovsky
Master II
Master II

aggr(if(rank(total expression)<11, Dimension,'Other'),Dimension)

Not applicable
Author

Thanks its working great. But placing 'Others' in else part of if, is not working..I want to sum all other dimensions under the label of 'Others'. Any Idea...

vgutkovsky
Master II
Master II

It should work. Please post an example of your application.

Not applicable
Author

Hi,

Its working fine now..I added the 'Other' inside the aggr, and also aggr the sorting expression.

Thanks a lot Smile