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

Custom Calendar in Qlik Sense 3.2.4 with independent days from range of month.

Goodmorning everyone. Hi work in Qlik Sense 3.2.4


I should create a calendar that selects several years and months and a range of days works in the following ways:


I'm using the extension:




Years selected: 2015 - 2016 - 2017

Months selected: January - February -  March - April

Days selected: 01 -02 -03 -04 -05 -06 -07 -08 -09 -10


The data selected must be those of: all years
and for the months: all months until the end of March and April until the 10th.

( Years >= 2015, Months >= January  and <= March , Days >= 10)



Thanks to everyone for the collaboration


Bye


Manuel

1 Solution

Accepted Solutions
Vasiliy_Beshentsev
Creator III
Creator III

Here is your solution:

LET varMinDate = Num(MakeDate(2015));                  //first date

LET varMaxDate = Floor(num(Today()));

TempCalendar1:

LOAD

              $(varMinDate) + Iterno()-1 As Num,

              Date($(varMinDate) + IterNo() - 1) as TempDate

              AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

TempCalendar2:

Load

              TempDate AS Date1

              ,Year(TempDate) As Year1

              ,Month(TempDate) As Month1

Resident TempCalendar1

where Day(TempDate) <= 10 and Match(Month(TempDate), 'янв', 'фев', 'мар', 'апр') > 0;

Drop Table TempCalendar1;

View solution in original post

15 Replies
Vasiliy_Beshentsev
Creator III
Creator III

1. Genereate temp autocalendar use your mindate and maxdate.

2. Load calendar table using your filters.

Vasiliy_Beshentsev
Creator III
Creator III

Here is your solution:

LET varMinDate = Num(MakeDate(2015));                  //first date

LET varMaxDate = Floor(num(Today()));

TempCalendar1:

LOAD

              $(varMinDate) + Iterno()-1 As Num,

              Date($(varMinDate) + IterNo() - 1) as TempDate

              AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

TempCalendar2:

Load

              TempDate AS Date1

              ,Year(TempDate) As Year1

              ,Month(TempDate) As Month1

Resident TempCalendar1

where Day(TempDate) <= 10 and Match(Month(TempDate), 'янв', 'фев', 'мар', 'апр') > 0;

Drop Table TempCalendar1;

Anonymous
Not applicable
Author

Thanks for your answer.


How can I use the Year, Month, and Day selection that are selected in the selection bar ??


Bye

Anonymous
Not applicable
Author

Detail better my need


The data extracted must be:
Year = 2017
Month = all day of Months selected in Bar (01/02/03/04) and for month 05 days <= 10
RangeDatewithDay.jpg

If more years are selected in the bar, the period must also be the same.

For Example:

The data extracted must be:
Year = 2016
Month = all day of Months selected in Bar (01/02/03/04) and for month 05 days <= 10

thank you

Manuel

Vasiliy_Beshentsev
Creator III
Creator III

Your question was how to make custom calendar isn't it?

Vasiliy_Beshentsev
Creator III
Creator III

And now you asking for selection help which not meant to the fisrt question.

I suggest you to close this or/and open new topic for selections.

So in selection topic i ask on your second question.

Anonymous
Not applicable
Author

For that, your solution is perfect, but I have to add what I have detailed in the answer, is it possible ???

thank you

Anonymous
Not applicable
Author

OK

Vasiliy_Beshentsev
Creator III
Creator III

Anyway...

What do you mean here 'If more years are selected in the bar, the period must also be the same' ?

Be the same for what? For some table, chart, KPI?