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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
BigKev
Contributor
Contributor

Dynamic year changes

Hi Everyone,

So I have hard coded my upper and lower limit of my date value on my script in load editor. I later found that the year should be +1 every financial year (1st of July)

*For current year:
If (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/11/2019') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('31/10/2020') as Invoice_Group_A,
If (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/05/2019') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('30/04/2020') as Invoice_Group_B,
if (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/05/2018') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('30/04/2019') as Invoice_Group_C

 

*From 1st July 2021, all the year value should be changed to:
If (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/11/2020') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('31/10/2021') as Invoice_Group_A,
If (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/05/2020') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('30/04/2021') as Invoice_Group_B,
if (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) >= date('01/05/2019') and (Date(Date#(Invoice_dt,'DDMMMYYY'),'DD/MM/YYYY')) <= date('30/04/2020') as Invoice_Group_C

Could anyone please help how to set the year value to change depending of the current year. I also need the date and month stay the same.

Thank you.

 

Labels (2)
1 Reply
ArnadoSandoval
Specialist II
Specialist II

Hi @BigKev 

I understand Financial Years between 1st July - 30th June, what confuse me is the calendar limits in your script, as you are using 1st Nov - 30th Oct; Would you please elaborate more about these dates!

You need to implement a Master Calendar that will bridge these two calendar, but I could not guide you further with the information present in your post.

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.