Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need to take Month, year and day from date field

Hi All,

I Have a field 'SDate' in the format of '08-JUL-15' in an exel sheet.

My requirement is to create List boxes with Day, Month and Year divided.

Please help me with your ideas.

Thanks,

Arun

5 Replies
swuehl
MVP
MVP

Try like

LOAD Day(Date) as Day,

          Month(Date) as Month,

          Year(Date) as Year,

          Date;

LOAD Date#(SDate, 'DD-MMM-YY') as Date

FROM ....;

sunny_talwar

You can do the following in your script:

LOAD Date(Date#(SDate, 'DD-MMM-YY')) as SDate.

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

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

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

FROM source;

and then create list boxes for Day, Month and Year

jafari_ervin
Creator III
Creator III

Also you can do it with left , Right , and Mid Function.

left(Date,2) as Day

Mid(Date , 4,3) as Month

Right(Date,2) as Year

Best

qlikmsg4u
Specialist
Specialist

Hi

In Script:

LOAD Day(Date) as Day,

          Month(Date) as Month,

          Year(Date) as Year,

          Date;

LOAD Date#(SDate, 'DD-MMM-YY') as Date from Source;

In UI:

=Date(Floor(Date#(SDate,'DD-MMM-YYYY')))

=Month(Date(Floor(Date#(SDate,'DD-MMM-YYYY'))))

=Year(Date(Floor(Date#(SDate,'DD-MMM-YYYY'))))

sasiparupudi1
Master III
Master III

Please see the attachement.

Close this thread if you got your answer .