Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkumargowda
Creator
Creator

Sorting with week and year as two dimensions in line chart

Hello Experts,

I'm trying to plot a line chart to do year by year analysis. Dimensions are week numbers and year. But the problem is sorting is not working for year dimension. As I don't have 2019's early weeks data, 2020 is being shown first in the legend. But I want the year to be sorted in ascending order (i.e. 2019, 2020) in the legend.

Dimensions: week(Fact_Date), year(Fact_Date)

Measure: Sum(Fact_value)

SET DateFormat='DD/MM/YYYY';

Temp:
Load Fact_value,date#(Fact_Date,'DD/MM/YYYY') as Fact_Date inline
[
Fact_Date,Fact_value
03/04/2019,3
03/03/2019,2
03/05/2019,5
03/06/2019,7
03/02/2020,1
03/01/2020,9
03/04/2020,6
03/03/2020,4
]

  

manojkumargowda_0-1588330355332.png

 

Labels (2)
1 Reply
Deepak87
Partner - Contributor III
Partner - Contributor III

Hi,

try this...

In Sorting:

First--> Sorting "Custom" --> check in "sort by expression" (add the expression "<Year>" ) --> Ascending