Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Jogi
Contributor III
Contributor III

Generate years in a row

Hi, does anybody know the easiest way to get value

 let  vYears = '2019','2020','2021'

Thank you 

Labels (2)
1 Solution

Accepted Solutions
anushree1
Specialist II
Specialist II

I do not understand the need in this requirement as you are representing year numbers using string.

But, you can get what you need by using the below statement:

let vYears =chr(39)&year(today())&chr(39)&','&chr(39)&year(AddYears(Today(),1))&chr(39)&','&chr(39)&year(AddYears(Today(),2))&chr(39);

 

View solution in original post

6 Replies
AdiPai
Creator II
Creator II

Hey Jogi ,

 

the below should provide you an idea of how this can be done -

clipboard_image_1.png

 

Result 

clipboard_image_2.png

Jogi
Contributor III
Contributor III
Author

I need something like that : 

clipboard_image_0.png

 

anushree1
Specialist II
Specialist II

what value are you looking for in case you want to generate the below yrs dynamically you could probably use:

let vYears =year(today())&','&year(AddYears(Today(),1))&','&year(AddYears(Today(),2));

Jogi
Contributor III
Contributor III
Author

hey I still get just numbers, but I need years with quotation marks like '2019' ,'2020' ....an so on

anushree1
Specialist II
Specialist II

I do not understand the need in this requirement as you are representing year numbers using string.

But, you can get what you need by using the below statement:

let vYears =chr(39)&year(today())&chr(39)&','&chr(39)&year(AddYears(Today(),1))&chr(39)&','&chr(39)&year(AddYears(Today(),2))&chr(39)

anushree1
Specialist II
Specialist II

I do not understand the need in this requirement as you are representing year numbers using string.

But, you can get what you need by using the below statement:

let vYears =chr(39)&year(today())&chr(39)&','&chr(39)&year(AddYears(Today(),1))&chr(39)&','&chr(39)&year(AddYears(Today(),2))&chr(39);