Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AUTOGENERATE (makedate(2013,1,1)-1) - MakeDate(2011,1,1) + 1;

Hi everyone,

             I am new to qlikview,please have look to it.

Calendar:

LOAD

Date(Date#(20101231,'YYYYMMDD')+RecNo(),'MM-DD-YYYY') AS [Link Date]

AUTOGENERATE (makedate(2013,1,1)-1) - MakeDate(2011,1,1) + 1;

In this scenario,I dont want to make hardcoded in year values.since i need to change year values when New year starts in makedate function.so i need to display the current year and previous year thats it.

is there anyway?

Thanks

Anish

1 Solution

Accepted Solutions
pauljohansson
Creator III
Creator III

Hi Anish, 

If you want a calender for the current & previous year without any hardcoded dates, one way is:   

Calendar: 

LOAD  date(makedate(year(today())-1)-1+RecNo(),'MM-DD-YYYY') as [Link Date] 

AUTOGENERATE (makedate(year(today())+1) - makedate(year(today())-1));  

br Paul

View solution in original post

5 Replies
udit_kumar_sana
Creator II
Creator II

Hi,

You can try  as below

for current year :-year(today())

for previous year:-only(year(today())-1)

Regards,

Udit

senpradip007
Specialist III
Specialist III

hi

You can use as follows

LET vFromDT = Num(AddYears(YearStart(Today()),-2));

LET vCurDT = Num(YearStart(Today()));

Calender:

LOAD

Date($(vCurDT) +RecNo(),'MM-DD-YYYY') AS Date

AutoGenerate vCurDT - vFromDT + 1;

Regards,

Pradip

pauljohansson
Creator III
Creator III

Hi Anish, 

If you want a calender for the current & previous year without any hardcoded dates, one way is:   

Calendar: 

LOAD  date(makedate(year(today())-1)-1+RecNo(),'MM-DD-YYYY') as [Link Date] 

AUTOGENERATE (makedate(year(today())+1) - makedate(year(today())-1));  

br Paul

Not applicable
Author

Hi,

Find the attached file I hope will be helpful.

Thanks&Regards,

Sampath

Not applicable
Author

Thank you so much..