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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extracting month form Date filed

Hi,

I'm using qlikview 11 and i wanted to extract Month from Date field.

I have Date field as below:

day_id
20110716
20110922
20110923

The above date is in yyyymmdd format. Now i wanted to extract the months as 07,09,09 and on the chart i wanted to show the month's name as July,September. Showing month's name can be acheived by using Load inline but how to extract the month from the date field?

17 Replies
Not applicable
Author


Hi, the solution suggested by you is working fine for me. Here i have small doubt. Why we are loading first and how it will come to know that we are loading date table as we are not mentioning any hive database or table name in the load statement.

Please clarify this doubt.

antoniotiman
Master III
Master III

Hi,

this is a behavior of QV called PRELOAD.

The PRELOAD works in Select/Load following.

Is the same that Select/Load and following Load ... Resident.

Regards,

Antonio

SunilChauhan
Champion II
Champion II

we can load a many as load statement  above a load with path.

Sunil Chauhan
Not applicable
Author

its not working

its_anandrjs
Champion III
Champion III

Try your script with preceding load statement then load like below scripts

LOAD

    "day_id",

    "quarter_id",

    "week_id",

    "year_id",

    Month("day_id") as Month;

SQL SELECT

    "day_id",

    "quarter_id",

    "week_id",

    "year_id"

FROM HIVE.orderdetails.day1;

Not applicable
Author

my date field is in the format of 2022011

2 date 02 month 2011 year

how to retrieve that month?

'in the excel file date is

20022011

bcoz  0 is the valueless before number

Anonymous
Not applicable
Author

Hi,

Something like below,

Month(Date#(02022011, 'DDMMYYYY'))

its_anandrjs
Champion III
Champion III

If in excel it is in format 20022011 means DDMMYYYY

Then use 

Month(Date#(Datefield,'DDMMYYYY'))

Or

Month(Date(Date#(Datefield,'DDMMYYYY'),'MM'))

If in excel it is in format 2022011 means DMMYYYY

Month(Date#(Datefield,'DMMYYYY'))

Or

Month(Date(Date#(Datefield,'DMMYYYY'),'MM'))