Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add decade to my calendar?

Usually I use nest script

Calendar:

Declare Field Definition Tagged '$date'

Parameters first_month_of_year=1

Fields

   year($1) as year Tagged '$year',

   month($1) as month Tagged '$month',

   week($1) as week Tagged '$week',

   date($1) as date Tagged ('$data', '$day')

Groups

year,month,date type collection as YearMonthDate;

Derive Fields from Fields MyValue Using Calendar;

And please help me, how to add decade (10 days) to my calendar?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Decades are usually periods of 10 years, not 10 days. So perhaps like this:


Calendar:

Declare Field Definition Tagged '$date'

Parameters first_month_of_year=1

Fields

   year($1) as year Tagged '$year',

   month($1) as month Tagged '$month',

   week($1) as week Tagged '$week',

   date($1) as date Tagged ('$data', '$day'),

   floor(year($1),10) as decade Tagged '$decade'

Groups

year,month,date,decade type collection as YearMonthDate;

Derive Fields from Fields MyValue Using Calendar;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Decades are usually periods of 10 years, not 10 days. So perhaps like this:


Calendar:

Declare Field Definition Tagged '$date'

Parameters first_month_of_year=1

Fields

   year($1) as year Tagged '$year',

   month($1) as month Tagged '$month',

   week($1) as week Tagged '$week',

   date($1) as date Tagged ('$data', '$day'),

   floor(year($1),10) as decade Tagged '$decade'

Groups

year,month,date,decade type collection as YearMonthDate;

Derive Fields from Fields MyValue Using Calendar;


talk is cheap, supply exceeds demand
Not applicable
Author

This is definitely what i want to do. Thank you.