Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Month year Filed

Hi all,

I am unable to get the values for Monthyear

Below is my script

LOAD  *,

                Year(date#(Date,'DD-MMM-YY')) as Year,

     Month(date#(Date,'DD-MMM-YY')) as Month,

    Day(date#(Date,'DD-MMM-YY')) as Day,

    Week(date#(Date,'DD-MMM-YY')) as Week,

    'Q' & ceil(Num(Month(date#(Date,'DD-MMM-YY')))/3) as Quater,

   Dual(Month(Date) & '-' & Date(Date, 'YY'),

    Num(Year(Date)) & Num(Month(Date), '00')) AS MonthYear,

   

   

    //Date(MonthStart(Date), 'MMM-YYYY') as [Month-Year],

i trid abve  for that  but it is not givng the values?

1 Solution

Accepted Solutions
sunny_talwar

It seems like your date isn't interpreted as date, may be this:

MonthName(Date#(Date,'DD-MMM-YY')) as MonthYear


or


Date(MonthStart(Date#(Date,'DD-MMM-YY')), 'MM-YY') as MonthYear

View solution in original post

8 Replies
sunny_talwar

Why don't you use MonthName() function or Date function?

MonthName(Date) as MonthYear


or


Date(MonthStart(Date), 'MM-YY') as MonthYear

sunny_talwar

Date functions are already dual in nature and hence if you use them, you will not have to use Dual function to assign them text and numeric values. Are you looking for a specific format for MonthYear?

sasiparupudi1
Master III
Master III

Date(date#(Date,'DD-MMM-YY') ,'YYYYMM')  as YYYYMM,

Chanty4u
MVP
MVP
Author

i tried but no use sunny ... same result

sunny_talwar

It seems like your date isn't interpreted as date, may be this:

MonthName(Date#(Date,'DD-MMM-YY')) as MonthYear


or


Date(MonthStart(Date#(Date,'DD-MMM-YY')), 'MM-YY') as MonthYear

Chanty4u
MVP
MVP
Author

No specific format....  jst i want monthyear field

sunny_talwar

I would recommend using MonthStart so that Day is normalized to 1 and MonthYear field doesn't repeat in list box

Chanty4u
MVP
MVP
Author

thnks sasi .

ur  expression is also wrkng same wat i want