Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Sort by expression using one measure and one dimension

I am sorting the rows in my table by expression. Right now I'm using one of my dimensions (Say we call is Dimention1) as the expression to sort, but I need to sort rows by another measure (say we call it Measure1), too. Is this possible?

Right now the expression is basically: Dimension1

If I change it to sum(Measure1), then I lose the sorting by Dimension1. How can I have both?

Thanks!

10 Replies
MVP
MVP

Re: Sort by expression using one measure and one dimension

Can you describe a bit closer how your want to sort your table (e.g. by some sample lines of sample data)?

I think you should be able to use the sort properties to define the sort order, i.e. sort first by X, then by Y

MVP
MVP

Re: Sort by expression using one measure and one dimension

May be RangeSum(Dimension1, Sum(Measure1))

It would be better if you provide real sample instead of just names because we won't really know the data behind the names and it becomes difficult to provide accurate answers.

Not applicable

Re: Sort by expression using one measure and one dimension

Sample to expand more on what I'd want to do:

   

IDNameCityMeasure1
12AlexWinnipeg156
35JustinHalifax800
57TinaToronto299
87PatriciaHalifax200
35JasonWinnipeg580

I have Measure1 as a measure in my pivot table, name in Rows, and City in columns. I want to sort the rows in a way that it first sorts by City, and then for each City, sorts by Measure1. Result in the following:

   

City
NameHalifaxTorontoWinnipeg
Patricia200--
Justin800--
Tina-299-
Alex--156
Jason--580
Not applicable

Re: Sort by expression using one measure and one dimension

Sure, please see my reply below.

Not applicable

Re: Sort by expression using one measure and one dimension

Thanks, that did not work unfortunately, but please see my reply below

Re: Sort by expression using one measure and one dimension

How many dimensions and how many measures have you added to your table?

You can use the Data, Add Column option to add as many dimension and measure columns as you require.

Sense_AddColumn.JPG

Not applicable

Re: Sort by expression using one measure and one dimension

Yes that's right, but I need to sort my names, adding more dimensions/measures won't solve the problem

Re: Sort by expression using one measure and one dimension

Expand the Sorting option and add the dimensions and measures you wish to sort by. 

Sense Sorting.JPG

Not applicable

Re: Sort by expression using one measure and one dimension

I want to sort my Name dimension by 2 different things: 1. City dimension , and then 2. Measure1