Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

how to display date in month-year format

Hi,

Date in excel table is in this format- Jan-10 and i want it to be same in  QV, but m getting as 40179.

what to write in EditScript?

Month as ----------

Thanks in Advance

Sagar Gupta

1 Solution

Accepted Solutions
Not applicable

how to display date in month-year format

Try this

Date(MDate,'MMM-YY') as MonthYear

10 Replies
christophebraul
Contributor III

how to display date in month-year format

Hi,

You can try MonthName(YourDate). This function gives you the month as defined in the SET MonthNames at the beginning of your script, and the year.

chauhans85
Esteemed Contributor

how to display date in month-year format

MonthName(fieldname ) as MonthYear

Not applicable

how to display date in month-year format

Hi,

Thanks for reply.

I tried: Load MonthName(Months) as MonthYear,    where Months is my feild name containing dates in this format(Jan-10).

:-( Its not working, my chart showing " no data to display"

Regards

Sagar Gupta

Not applicable

how to display date in month-year format

Try this

Date(MDate,'MMM-YY') as MonthYear

chauhans85
Esteemed Contributor

how to display date in month-year format

better you can share sample file.

Not applicable

how to display date in month-year format

Hi,

Thanks for reply.

I tried: Load MonthName(Months) as MonthYear,    where Months is my feild name containing dates in this format(Jan-10).

:-( Its not working, my chart showing " no data to display"

Regards

Sagar Gupta

how to display date in month-year format

Hi,

Which type of chart you creating.

Regards,

Anand

adhudson
Contributor II

how to display date in month-year format

Hi,

     You can format the given date with the date function like below.

     Date(givenDate,'MMM-YYYY') returns any date in MMM-YYYY format.

     But remember it is just the formatting of the date.

     Lets say if you have two dates for the same month as 29/04/2012 and 30/04/2012.

     For both of the dates, the above formatting function returns Apr-2012. But still the original values are not changed.

     So if you use this as a dimension in a chart, it will show 'n' number of same values 'Apr-2012' as it is available in the data. In this case, you can see two Apr-2012s in the chart.

     If you feel any problem with this solution, there is always another way of doing it.

     Date(MakeDate(Year(givenDate),Month(givenDate),1),'MMM-YYYY') AS anotherDateColumn.

     You can use this to create new column 'anotherDateColumn'.

     So you will get the table like the below.

     givenDate     anotherDateColumn

     29/04/2012     Apr-2012 (Original Value:01/04/2012)

     30/04/2012     Apr-2012 (Original Value:01/04/2012)

Regards

Andrew Hudson

chauhans85
Esteemed Contributor

how to display date in month-year format

you can also try this

MonthName(makedate(20&  right(Month,2),num(left(Months,3)))) as MonthName

Community Browser