Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sort values in input box

I am populating an inputbox with the values of a field using concat function and now I want to sort the values.

Any help is appreciated.

Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Looks like the most reliable way is combination of both. Take a look, notice the properties of the variables.
I use expression that handles both YYYY-MM and YYYY-M situations.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Raj,
Can you provide some more details? Concat function can use optional paramater for sort order, but I can't tell if it's relevant to your question.

Not applicable
Author

Michael,

I am populating 'YYYY-MM' values from year_month field in two inputboxes to be able to make comparison of facts between these two time periods. The problem is it a string field so it will not return numeric value when passed as a parameter for sort order in cancat function.

Is there any way to get around?

Thanks.

Anonymous
Not applicable
Author

One possible way is to convert string to a date, like this before using for comarison:
makedate(left(PeriodStart,4), right(PeriodStart,2))
Another is to force user to enter in a date format (that ccould be YYYY-MM)

Anonymous
Not applicable
Author

Looks like the most reliable way is combination of both. Take a look, notice the properties of the variables.
I use expression that handles both YYYY-MM and YYYY-M situations.

Not applicable
Author

Thanks for all your help Mike !!