Discussion board where members can get started with QlikView.
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
Go to Solution.
Date(MDate,'MMM-YY') as MonthYear
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.
MonthName(fieldname ) as MonthYear
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"
better you can share sample file.
Which type of chart you creating.
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.
29/04/2012 Apr-2012 (Original Value:01/04/2012)
30/04/2012 Apr-2012 (Original Value:01/04/2012)
you can also try this
MonthName(makedate(20& right(Month,2),num(left(Months,3)))) as MonthName