- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorting quarter and year values on a line chart
Hi all,
I am trying to sort quarter and year values on the x-axis on a line chart. Eg. q1-2017, q2-2017, q3-2017, Q4-2017, Q1-2018, etc
In my csv file I have two different fields for both quarters (q1, q2, q3, q4) and a year field for respective quarters (2016, 2017, 2018 etc)
I have already combined the fields in Qlik sense by Quarter_Value&'-'&Year in the line chart
Can anyone help please?
- Tags:
- date sorting
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be create your field as a dual field like this
Dual(Quarter_Value&'-'&Year, Year*100 + (Right(Quarter_Value, 1) * 1), ) as QuarterYear
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be create your field as a dual field like this
Dual(Quarter_Value&'-'&Year, Year*100 + (Right(Quarter_Value, 1) * 1), ) as QuarterYear
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a new column using the below script.
Num(Year&Replace(Quarter_Value,'q','')) as Quarter_Value1
Select the Sort by Expression option, then use the newly created column.
Quarter_Value1
Then Select Ascending.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!