Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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.
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
we can load a many as load statement above a load with path.
its not working
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;
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
Hi,
Something like below,
Month(Date#(02022011, 'DDMMYYYY'))
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'))