Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating variables for Years and Period


I need to create a chart that has rolling years and periods

I've managed to create varaibles for the Periods 1 to 12 but I need to create another variable for the year

Another complication is that the periods and years are not aligned to calendar period and years

So:

Aug = 01 through to July = 12

This is what I've created for the periods, but what I need now is a variable that allows be to roll the year when the period is = August. I'm then want to call the variables so that I can return a value for each period in multiple years

let

V_PERIOD

= num

(month

(addmonths

(today

(),5)),'00');
let

V_PERIODP2

= num

(month

(addmonths

(today

(),6)),'00');
let

V_PERIODP3

= num

(month

(addmonths

(today

(),7)),'00');
let

V_PERIODP4

= num

(month

(addmonths

(today

(),8)),'00');
let

V_PERIODP5

= num

(month

(addmonths

(today

(),9)),'00');
let

V_PERIODP6

= num

(month

(addmonths

(today

(),10)),'00');
let

V_PERIODP7

= num

(month

(addmonths

(today

(),11)),'00');
let

V_PERIODP8

= num

(month

(addmonths

(today

(),12)),'00');
let

V_PERIODP9

= num

(month

(addmonths

(today

(),13)),'00');
let

V_PERIODP10

= num

(month

(addmonths

(today

(),14)),'00');
let

V_PERIODP11

= num

(month

(addmonths

(today

(),15)),'00');
let

V_PERIODP12

= num

(month

(addmonths

(today

(),16)),'00');

1 Reply