Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Month Year Field

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

1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Month Year Field

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

View solution in original post

7 Replies
Highlighted
Partner
Partner

Month Year Field

Hi Laura,

Use this Script Syndex Date(Field1,'MMM/YYYY').

Regards,

Perumal.A

Highlighted
Creator III
Creator III

Month Year Field

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

View solution in original post

Highlighted
Not applicable

Month Year Field

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

Highlighted
Partner
Partner

Month Year Field

Hi Laura,

Try this script Date(makedate(year(today()),month(today()),Day(today())),'MMM/YYYY')

Regards ,

Perumal A

Highlighted
Partner
Partner

Month Year Field

Try using This:

Date(YourDateField,'MM/YYYY').

Highlighted
Not applicable

Month Year Field

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?

Highlighted
Creator III
Creator III

Month Year Field

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