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: 
tan_chungkam
Creator
Creator

Date Sorting / Category

Hi all,

My company financial year is from Oct - Sep every year.

Thus, i would like to sort or categorize the date in bar chart accordingly e.g. Oct-2018 ~ Sep-2019 / Oct-2019 ~ Sep-2020.

TableTableBar ChartBar ChartScriptingScripting

Is that possible to categorize (Oct-2018 ~ Sep-2019) as 2018/2019 and (Oct-2019 ~ Sep-2020) as 2019/2020?

Labels (5)
1 Reply
vunguyenq89
Creator III
Creator III

Hi, you can create a FiscalYear  field similar to the following script:

Set vStartMonth = 10; 
Load Dual(fYear-1 &'/'& fYear, fYear) as FiscalYear,
    *;
Load Year + If(Month>=$(vStartMonth), 1, 0) as fYear,
     *;
LOAD * INLINE [
Year, Month
2018, 8
2018, 9
2018, 10
2018, 11
2018, 12
2019, 1
2019, 2
2019, 3
2019, 4
2019, 5
2019, 6
2019, 7
2019, 8
2019, 9
2019, 10
2019, 11
2019, 12
2020, 1
2020, 2
2020, 3
2020, 4
2020, 5
];

The new field after reload is as followsFiscalYear.png

Detailed explanation in the following blog post: https://community.qlik.com/t5/Qlik-Design-Blog/Fiscal-Year/ba-p/1472103