Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have date field with time stamp and I need to convent month_year format and write the rolling 12 months expression.
Creation_date
29/03/2018 22:10:07
29/03/2018 22:18:10
30/04/2018 10:12:15
30/04/2018 12:10:11 like that. I need convent like below
Mymonth:
MAR-2018
APR-2018
and using mymonth as dimension and creating line chart with rolling 12 months expression.
How to do this. I am trying but it is not showing properly. Please help on this.
To get the monthyear, you can usethe MonthName function.
MonthName(Creation_date) as Month_Name
it will return the month and year
If you want to format the Creation_date column to Month value( 1,2,3 etc), use the below script
Date(Date#(Creation_Date,'DD/MM/YYYY hh:mm:ss'),'MM') as Creation_Month_Value
OR
Date(Creation_Date,'MM') as Creation_Month_Value
Hi Chaitanya,
Please try below:
Date(Date#(Creation_date,'DD/MM/YYYY HH: MM:SS'),'MMM-YYYY') as Mymonth,
Thanks,
Arvind Patil
I suggest you to create a master calendar, take a look at Creating A Master Calendar
Use fllowing expression in your load script :
UPPER(DATE(DATE(Creation_date,'DD/MM/YYYY'),'MMM-YYYY')) as Mymonth