Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've been searching this community for ways to sort bar charts by date. I've seen some examples in which people asked for sorting graphs by month (in which the suggestion is to use MonthStart), but I would like to sort by day.
In the data load editor I'm loading the date by using the following code:
Load
Date("Trade Date",'YYYY-MM-DD') as "Trade Date",
Identifier
FROM [lib://Desktop/sheet1.xlsx] (ooxml, embedded labels, table is 'sheet1');
Who knows how to do this?
Dear all,
I found the solution as follows:
Click Edit,
Select the bar chart,
Click "Sorting" on the right of the screen,
Drag Trade Date up
Thanks for thinking along.
Regards, Eveline
Dates are dual, if you cerate them correctly, that is they have both string and numeric values. All you have to do is to sort date field by the numeric value.
If your dates are just the strings - use date#()function to format them as dates. For example if they are strings in format YYYY-MM-DD, use:
date(date#("Trade Date", 'YYYY-MM-DD'))
HIC
Dear Michael,
My dates have only numeric values (in excel they consist of numbers only), however, sorting them numerically in Qlik Sense does not make a change. It's still sorted by values (large values first).
Ticking 'Sort by expression' and including the expression as you suggested, does not change the bar chart, it's still sorted by values instead of by dates.
Dear Henric,
since I'm working with Qlik Sense, I'm curious where exactly to put the formulas you are suggesting in your article. Do I need to put it in the Data model viewer? Or should I use it to sort my bar chart by expression? I tried both, like Michael Solomovich suggested in his reply, but no success unfortunately.
Dear all,
I found the solution as follows:
Click Edit,
Select the bar chart,
Click "Sorting" on the right of the screen,
Drag Trade Date up
Thanks for thinking along.
Regards, Eveline
I suggested to sort by numeric, not by expression... And, you have to uncheck sort by value.
Can you upload a QVW version of your app?
It's really the same thing. What both Michael and I are suggesting, is to use the combination Date(Date#(...)) in the Load script, and sort the object numerically. You can use sort by expression, too, but this is overkill and not as efficient...
HIC