Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gkcchowdary
Contributor

how to change my date format?

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.

4 Replies
sibin_jacob
Contributor III

Re: how to change my date format?

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

arvind_patil
Valued Contributor III

Re: how to change my date format?

Hi Chaitanya,

Please try below:

Date(Date#(Creation_date,'DD/MM/YYYY HH: MM:SS'),'MMM-YYYY') as  Mymonth,


Thanks,

Arvind Patil

Partner
Partner

Re: how to change my date format?

I suggest you to create a master calendar, take a look at Creating A Master Calendar

Highlighted
arvind1494
Valued Contributor

Re: how to change my date format?

Use fllowing expression in your load script :

UPPER(DATE(DATE(Creation_date,'DD/MM/YYYY'),'MMM-YYYY')) as Mymonth