Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Sorting

Hi Dear

I have following command line in my data load script

DATE(POL_PERIOD_FROM,'MMM-YY') &' - '& DATE(POL_PERIOD_TO,'MMM-YY') AS POLICY_PERIOD,

It is working in order and resulting records are as follows

 

Sep-13 - Sep-14
Sep-10 - Sep-11
Sep-11 - Sep-12
Sep-14 - Sep-15

I have created a pivot table and want sort above data in ascending order. What sort order I should select to do it . Numeric Value does not give the desired result. Pls help me

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want to sort it as a number then you should make it a number first. You can use the Dual function to do that:

DUAL( DATE(POL_PERIOD_FROM,'MMM-YY') &' - '& DATE(POL_PERIOD_TO,'MMM-YY'),POL_PERIOD_FROM)  AS POLICY_PERIOD


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want to sort it as a number then you should make it a number first. You can use the Dual function to do that:

DUAL( DATE(POL_PERIOD_FROM,'MMM-YY') &' - '& DATE(POL_PERIOD_TO,'MMM-YY'),POL_PERIOD_FROM)  AS POLICY_PERIOD


talk is cheap, supply exceeds demand
ecolomer
Master II
Master II

You can put an expression on label ordered:

=only({1} match(var, 'Sep-10 - Sep-11', 'Sep-11 - Sep-12', 'Sep-13 - Sep-14', 'Sep-14 - Sep-15') )

and also yu can assign a number each group 'Sep-11 - Sep-12' in ordor to use this number in the ordered set