Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
MonthName(fieldname ) as MonthYear
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
Try this
Date(MDate,'MMM-YY') as MonthYear
better you can share sample file.
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
Hi,
Which type of chart you creating.
Regards,
Anand
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
you can also try this
MonthName(makedate(20& right(Month,2),num(left(Months,3)))) as MonthName