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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

not able to extract Month name

Hi All,

I have a QVD stored with a  date field having format as DD/MM/YYYY, now when i try to extract the day and year, i am able to do it correctly but not able to extract the month field. please see the below details and advice or guide me if i am doing anything wrong.

  1. The date field has been created with the following statement

      date(date#(dates,'yyyymmdd'),'dd/mm/yyyy') as date

    2. I am trying to extract the year, month and day from the date filed using below statements

  • year(date) as year, month(date) as month, day(date) as day

Now Please see the below screenshot of the result

qvscreenshot.png

please help me resolve this issue. Thanks in advance.

1 Solution

Accepted Solutions
sumitjadhav
Creator II
Creator II

This Expression Worked,

month(Date#(Date1,'DD/MM/YYYY')) as month,

View solution in original post

12 Replies
sasikanth
Master
Master

HI,

Please post your sample data

Anonymous
Not applicable
Author

Sasi, thanks for replying. By posting sample data , you mean my sample QVW?

sasikanth
Master
Master

Yes, if possible qvw or else excel file containing raw date field.

Anonymous
Not applicable
Author

Sasi, please find the attached excel file with all the date data.

sasikanth
Master
Master

HI, I need raw data, please share your QVW,

Not applicable
Author

sample.png

Its Working

Anonymous
Not applicable
Author

When you have the date in DD/MM/YYYY in .qvd, why is it needed to use an expression again to convert it into 'DD/MM/YYYY' format? And if " date(date#(dates,'yyyymmdd'),'dd/mm/yyyy') " is exactly what you are using, "mm" returns minutes not months.

Please share your .qvd or .qvw for us to get the exact situation.

sumitjadhav
Creator II
Creator II

Try This,

load *,

date#(date,'DD-MM-YYYY') as Date1;

Data:

LOAD date

FROM

(biff, embedded labels, table is Sheet1$);

load

subfield(Date1,'/' ,1) as Day,

subfield(Date1,'/' ,2) as month,

subfield(Date1,'/' ,3) as Yearr

Resident Data;

Output:

dateoutput.JPG

Its Just a Time Being Solution,But I think there is Some Formatting issue in your  Excel ,Regarding the date field format is not correct,Please Check it once.

Thank's & Regards,

Sumit Jadhav.

dsharmaqv
Creator III
Creator III

try this

Month(date#(dates,'yyyymmdd') as date