
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to rename autocalendar fields
Hi,
I'm using the auto-generated calendar in Qlik Sense and want to rename the field names to make them more user-friendly.
The default names are [Date.autoCalendar.Year], [Date.autoCalendar.Month] etc, and I would like to rename them to just Year, Month etc.
I tried using RENAME FIELDS, but I doesn't seem to do anything.
Can anyone help?
Here's the script that generates the calendar and my attempt at renaming the fields:
[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
Month($1) AS [Month] Tagged ('$month', '$cyclic'),
Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden');
DERIVE FIELDS FROM FIELDS [Date] USING [autoCalendar];
RENAME FIELDS
[Date.autoCalendar.Year] TO Year,
[Date.autoCalendar.Quarter] TO Quarter,
[Date.autoCalendar.Month] TO Month,
[Date.autoCalendar.YearQuarter] TO YearQuarter,
[Date.autoCalendar.YearMonth] TO YearMonth;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anyone?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know as it is using TAGGED in your script.
Use your own generated Master Calendar, you'll have more control on dates and/or can create new fields within the master script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I think I'll go ahead and create my own calendar script then. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use below link and it's attachment to create your own master. Ofcourse you'd have to change the dates to adjust your fact dates (vMax and vMin) in script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
did you find the solution for this issue?
