Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a date field in the format of dd/mm/yyyy.
i want to create another field which uses the date field to get it in the format of mm/yyyy, so i can use it as a dimension on a graph.
What is the qlikview code to do this?
Thanks
Laura
Create a field like below in your table.
Month(Date_Field) & '/' & Year(Date_Field) AS MonthYear
so that you can use the MonthYear field in your graphs as dimensions.
Thanks,
Leni
Hi Laura,
Use this Script Syndex Date(Field1,'MMM/YYYY').
Regards,
Perumal.A
Create a field like below in your table.
Month(Date_Field) & '/' & Year(Date_Field) AS MonthYear
so that you can use the MonthYear field in your graphs as dimensions.
Thanks,
Leni
Hi , This worked to some extent but it has created several of the same dates.
It hasnt grouped the data in the same month and year.
Any advice?
Thanks
Laura
Hi Laura,
Try this script Date(makedate(year(today()),month(today()),Day(today())),'MMM/YYYY')
Regards ,
Perumal A
Try using This:
Date(YourDateField,'MM/YYYY').
The new problem is that it will not sort them in Date Order
i have tried all the combinations of the sort properties but none of them work.
Any ideas?
Hi,
The field Month(Date_Field) & '/' & Year(Date_Field) AS MonthYear is a string because we are concatenating two fields. So it will sort in an alphabetical order.
If you want to sort them in Date order then use the below one:
Date(Monthstart(Date_field), 'MMM/YYYY') as MonthYear
Thanks,
Leni