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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
schmidtj
Creator II
Creator II

Sorting and time dimension

Hi,

i have a sorting problem.

I have a time dimension/table drilled down to the following for the year 2000-2020: year, month, week, day, hour.

For sorting i have another field DATEID with the following format: YYYYMMDDHH.

Now i have a simple bar chart where i sum up a value over each hour of the current day.

The sorting works fine - i put a sorting using the formualr over the field DATEID.

However, if i do a bar chart where a put the months on the x-axis the sorting doesnt work anymore.

I dont understand the problem to be honest.

Can somebody help me out or give some advice?

13 Replies
schmidtj
Creator II
Creator II
Author

Ok, i found 'a' solution - however i have to say that it doesnt make sense and for me it is a bug in Qlik unless

somebody can give me another explanation.

I have an integer field [MONAT_SORT] in the format YYYYMM.

Using this field for sorting doesnt work when the data is being grouped down to the hour, so (YYYYMMDDHH).

If i do another field for sorting using this function the sorting works perfectly:

DATE#([MONAT_SORT], 'YYYYMM').

Maybe somebody can enlighten me ...

vinieme12
Champion III
Champion III

it's because Date(,'YYYMMM')   is still a Date; just formatted as YYYYMM

if you do NUM#(Date(,'YYYMMM') ) will be a whole number.

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
schmidtj
Creator II
Creator II
Author

Ok but i should be able to sort a whole number too, no?

vinieme12
Champion III
Champion III

yes;  NUM#(Date(,'YYYMMM') )   will work

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.