Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Creator III
Creator III

Create month year and week date in qlik

Hi All ,

I have below data fields :-

Left(Year(YearName(TempDate,0,4)),5) & '-'& IF(Month(TempDate)<=3, Month(TempDate)+9, Month(TempDate)-3) as Fiscal_Month_Year

 

IF(Month(TempDate)<=3, Month(TempDate)+9, Month(TempDate)-3) as New_Fiscal_Month_Num,

Dual(Month(TempDate), IF(Month(TempDate)<=3, Month(TempDate)+9, Month(TempDate)-3)) as New_Fiscal_Month,

Below is the output:-

Aspiring_Developer_0-1711043323734.png

 

I am trying to create Month year filter in this format :- MMM-YY . I used monthname and date filter but it is giving me dates Apr-1988 . 

And for week , I  am trying to create dates for that week , for example week 40 then it should show the dates for week 40 in the dimension.

Can anyone please help me ? @sunny_talwar 

Thanks in advance

 

Labels (2)
1 Solution

Accepted Solutions
Ryan_McGregor
Contributor II
Contributor II

Hello there, 

For the Month / Year filter, you could use this:

(Dual(Month(TempDate), IF(Month(TempDate)<=3, Month(TempDate)+9, Month(TempDate)-3))&'-'&right(Year(TempDate),2)) as MonthYearFilter

As for the Week, you can use this:

WeekStart(TempDate)&'-'&WeekEnd(TempDate) as WeekFilter

Hope this helps,

 

Ryan

View solution in original post

1 Reply
Ryan_McGregor
Contributor II
Contributor II

Hello there, 

For the Month / Year filter, you could use this:

(Dual(Month(TempDate), IF(Month(TempDate)<=3, Month(TempDate)+9, Month(TempDate)-3))&'-'&right(Year(TempDate),2)) as MonthYearFilter

As for the Week, you can use this:

WeekStart(TempDate)&'-'&WeekEnd(TempDate) as WeekFilter

Hope this helps,

 

Ryan