Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Converting Dates to Month to Qtr. to Year

Hi I have a column with Dates in my Data, I want further column from it which shows Month , Qtr, years. I am using below code:

[DISP_DATE],

  Week ([DISP_DATE]) as [DISP_Week],

  Month([DISP_DATE]) as [DISP_Month],

  Year([DISP_DATE]) as [DISP_Year],

  'Q-' & Ceil(Month([DISP_DATE])/3) as [DISP_Quater],

I am able to compile code without an error , but when I try to use Week , Month , year column in my dashboard there is no value, can someone please help me in this regard, I am very new to Qlik and not sure what error I am making .

Also, DISP_DATE columns have values like 01-Sep-2016 , 03-Sep-2016 .... 02-Oct-2016

13 Replies
mehmet_caldak
Partner - Contributor III
Partner - Contributor III

hi ,

can you attach the .qvf file and the  excel file.

Anonymous
Not applicable
Author

Thanks a ton Jagan, it's working now , can you please help me understanding why we added first Load statement for Date conversion? And can't we do it with one single Load.

Thx

Ankit

Anonymous
Not applicable
Author

Thanks Sunny for correcting me, yes its MMM

Regards,

Ankit

sunny_talwar

Also is it - between them or /? Make changes to your environmental variable accordingly

SET DateFormat='DD-MMM-YYYY';

or

SET DateFormat='DD/MMM/YYYY';