Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vkal12
Creator
Creator

Concatenated dimension in bar chart - sort values individually by date

Hello Community,

I have a bar chart where my dimension is a concatenation of Date and Category, e.g. 06.03.2023 - A, 06.03.2023 - B... 

My problem at the moment is that due to that concatenation I cannot sort the chart by date and therefore the start of my x-axis looks like this:
01.01.2023 - A
01.01.2023 - B
01.02.2023 - A
01.03.2023 - C
03.01.2023 - A
03.01.2023 - C
04.01.2023 - B 

Is there a possibility to sort this concatenated dimension by date so that it looks like this: 
01.01.2023 - A
01.01.2023 - B
03.01.2023 - A
03.01.2023 - C
04.01.2023 - B 
01.02.2023 - A
01.03.2023 - C

Thank you very much in advance!

Labels (3)
1 Solution

Accepted Solutions
Or
MVP
MVP

You could presumably do this by using a custom sort by Date, and also checking the String sort for the secondary (letter) sort. Alternatively, you could set this up as a dual() with a numeric value along the lines of num(Date)*100 + Ord(Category), which will sort first by the date value and then by the letter value when set to sort numerically.

View solution in original post

3 Replies
Or
MVP
MVP

You could presumably do this by using a custom sort by Date, and also checking the String sort for the secondary (letter) sort. Alternatively, you could set this up as a dual() with a numeric value along the lines of num(Date)*100 + Ord(Category), which will sort first by the date value and then by the letter value when set to sort numerically.

vkal12
Creator
Creator
Author

Hi Or,

thank you for your quick response. Do you have an example on how my Dual()-formula would look like? 

At the moment my formula for concatenation looks like this: Date & '-' & Category. 

Thank you!

 

vkal12
Creator
Creator
Author

Hi Or,

after trying around a little bit I solved the problem. In the option "Sorting" I used sorting by formula for my dimension and integrated the following formula: 

=Num(Date)* 100 + Ord(Category) 

Thank you very much for your support!