Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Not applicable

Custom Sort for Text Variable

Hi,

I have a calculated dimension if(Year = 'Current', [Current Course Age], [Previous Course Age] ) and I have labeled it as Course Aging.

The possible values under Current Course Age], [Previous Course Age] are

"First Run"

"1-2 Years Old"

"3-4 Years Old"

">=5 Years Old"

I want to be able to sort the calculated dimension in the order mentioned above.

Thanks!

Edit:Also, the Values have quotes in them.

Tags (1)
9 Replies
Highlighted

Re: Custom Sort for Text Variable

May be this:

Match(

If(Year = 'Current', [Current Course Age], [Previous Course Age]),

'First Run'

'1-2 Years Old'

'3-4 Years Old'

'>=5 Years Old')

Highlighted
Not applicable

Re: Custom Sort for Text Variable

I tried this expression under sort--> Expression. This did not work.

Also, the Values have quotes in them.

Highlighted

Re: Custom Sort for Text Variable

There is quotes... okay, try this may be

WildMatch(

If(Year = 'Current', [Current Course Age], [Previous Course Age]),

'*First *'

'*1-2 Years Old*'

'*3-4 Years Old*'

'*>=5 Years Old*')

Highlighted
Not applicable

Re: Custom Sort for Text Variable

Still does not work. I am using

=WildMatch(if (Year= 'Current' ,[CurrentCourseAgeDescription],[Previous Course Age Description]),'*First Run*', '*1-2 Years Old*','*3-4 Years Old*', '*>=5 Years Old*')

Highlighted

Re: Custom Sort for Text Variable

Would you be able to share a sample or screenshots?

Highlighted
Not applicable

Re: Custom Sort for Text Variable

Course Aging# of Total Courses% of Total # Courses
>= 5  Years Old130.60%
First Run27.50%
1-2 Years Old43464.00%
3-4 Years Old23214.80%
Contributor III

Re: Custom Sort for Text Variable

I think you should use this expression in Sort / Sort by / Expression.

Highlighted
Not applicable

Re: Custom Sort for Text Variable

I am using the expression in Sort / Sort by / Expression.

Highlighted

Re: Custom Sort for Text Variable

Hahahaha this is not what I asked for.... Would you be able to share a qvw app or may be some raw data?

Preparing examples for Upload - Reduction and Data Scrambling

Uploading a Sample