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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort issue with bar chart and display results in "=Day & ' - ' & Month"

My default date format = DD-MMM-YYYY (01-Jan-2010.

I Have a Calendermaster table with:

%Calenderday (DD-MMM-YYYY)

Year

Month (Jan-Dec)

Week

Day

Now i want to show my result in a bar chart with "=Day & ' - ' & Month" between a date. This is working so far. But now i have a problem with Sorting the results.

On default i get these results:

1.jpg

i tried expression sorting on "=Day".

This works when there is not a bigger timespan selected then 1 month. But when there are more months selected, you see the results like this

2.jpg

I also tried sorting on "=Day & ' - ' & Month" But then i get results like this

3.jpg

I even tried sorting on %Calenderday. But then the results look like this

4.jpg

Some advice is welcome here

Thanks a lot!

1 Solution

Accepted Solutions
jvitantonio
Specialist III
Specialist III

No because you concatenate 2 fields and this is no longer a date field,. You can try

date(makedate(Year, Month, Day) , 'DD-MMM')

View solution in original post

5 Replies
jvitantonio
Specialist III
Specialist III

Hi, please create a new filed in your script like this:

date(%Calenderday, 'DD-MMM') as DayMonth

You this in your charts and order by this field.

Hope this helps.

Not applicable
Author

I know this would be a solution. But is there no other way then alter my datamodel or add code to my current report?

jvitantonio
Specialist III
Specialist III

No because you concatenate 2 fields and this is no longer a date field,. You can try

date(makedate(Year, Month, Day) , 'DD-MMM')

jvitantonio
Specialist III
Specialist III

Here's an example:

Not applicable
Author

Thanks a lot! This trick Seems to do it. But the performance goes down a lot.

So i have changed my Datamodel instead with your first solution. Seems to be faster.