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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

How to SORT date in Straight Table?

Hi All,

I am using one straight table like below. Date is my dimension.

Date2014-June2014-Feb2013-Dec2013-Oct2013-Sep2013-Aug2010-Jan2011-Dec2009-Oct
Expression 1322353124
Expression 2127321098
Expression 3245217421

Now I want to sort my Date Fields like following

Date2014-Feb2014-June2013-Aug2013-Sep2013-Oct2013-Dec2011-Dec2010-Jan2009-Oct
Expression 1
Expression 2
Expression 3

I done the changes in sort tab. I selected Date field and under sort by box I selected numeric values = desending, but its not working.

Please help me regarding this. In my application its look like below image:

Date.png

Labels (1)
9 Replies
MayilVahanan

Hi

Try like this

Chart properties -> sort -> expression (Ascending)

=MonthName(Date)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

Hi Soha,

sure it can't worm like this because you mix different sorting ways.

I understand you want Last year descending but months ascending

you have to build your own sort key for that in the script and sort the table on SortKey

best regards

Chris

CELAMBARASAN
Partner - Champion
Partner - Champion

I don't think its a numeric/date field. It its so then it will get sorted.

Try with this as calculated dimension

Date(Date#(YourFieldName, 'YYYY-MMMM'), 'YYYY-MMMM')

For consistent solutions in all the places you should the change the way of creating this field in script itself.

its_anandrjs
Champion III
Champion III

Hi Soha,

Are you sure there is single dimension it looks like 3 expression with different month names.

If it is single then in sort tab select sort by expression and write expression MonthName(DateField) and Descending

soha1902
Creator
Creator
Author

Thanks for your reply. I tried to wrote expression MonthName(<MyDateFieldName>) but still its not sorting.chartExp.png

chart.png

Please help...

soha1902
Creator
Creator
Author

Actually from script date is coming in Date(<DateField>,'YYYY-MM') format.

But in chart I am convering in Date(<DateField>,'YYYY-MMM') format.

soha1902
Creator
Creator
Author

Please help.

MayilVahanan

Hi

Bring Number field like Num(Datefield) as DateFieldNum from your script and use DateFieldNum in the expression.

Hope that helps.

Otherwise provide the sample file.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ajaygcet
Partner - Contributor II
Partner - Contributor II

Hi Soha ,

try Date(DateField,'YYYY-MM') in Sort by Expression.

or Convert it into Number like 'YYYYMM'