Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Specifying a specific ordering of values in table (part 2)

Moving on from my previous question yesterday (Specifying a specific ordering of values in table).


I have a column (e.g. field_A), which has 4 unique values.


Field_A            freq (based on $)             freq (based on 1)

-----------          ----------------                        -----------------

Value_s                 1                                   4

Value_x                 0                                   3

Value_y                 3                                   7

Value_r                 0                                    2

I want to display this field in a straight table with a freq (which I can do) but I want to order field_A values in a specific order (not in ascending or descending) that I would like to define manually.

I use:

=match(Field_A, 'Value_s','Value_x','Value_y','Value_r')

which works fine if there is no selection (i.e. the third column) but otherwise due to 0 frequencies Field_A is not always ordered depending on the selection.

How can I have Field_A as a dimension but something like:

{1} Field_A

instead of just Field_A. SO that regardless of the selection, Field_A is always ordered in the:

=match(Field_A, 'Value_s','Value_x','Value_y','Value_r')

Revlin

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use this as sort expression

=only({1} match(Field_A, 'Value_X', 'Value_S','Value_Y','Value_R') )

View solution in original post

8 Replies
Not applicable
Author

have you try :

Not applicable
Author

yes I have but still the ordering of the dimension keeps changing depending on the selection

Not applicable
Author

post qvw file, so I can look inside:)

Not applicable
Author

Ok, please see attached (ABOVE).

Say I want the field to be displayed in the following order:

=match(Field_A, 'Value_x', 'Value_s','Value_y','Value_r')

It works fine if there is no selection, or if filter_field=A is selected.

However, if I select filter_field=B or filter_field=C then the ordering messes up.

Note: I want to show all values of Field_A all of the time.

swuehl
MVP
MVP

I don't see any data / chart when opening your attached sample file.

Have you tried disabling the 'suppress zero values' option in presentation tab? And maybe using a set expression in your frequency count expression?

Not applicable
Author

Sorry please try again

swuehl
MVP
MVP

You can use this as sort expression

=only({1} match(Field_A, 'Value_X', 'Value_S','Value_Y','Value_R') )

Not applicable
Author

perfect - thank you!