Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
holymosfet
Contributor III
Contributor III

Bookmark/Standard Filter to include all FY Periods

Hi all,

I'm working on an app where I want a standard filter to be applied when opened.
I guess a standard bookmark would be the right way but I just can't get it work:

I use the field below and I want all periods up to the current period to be included in the filter.
Let's say we are in period 6, period 01 to 06 should be included.

holymosfet_1-1636362334900.png

 

The current period is calculated with a variable vCP since our fiscal year starts in October. I refer to the newest order date in the loaded data.

vCP=pick(month(max([Order date])),4,5,6,7,8,9,10,11,12,1,2,3)

Does anyone know how to do it? I found this video but it seems like it doesn't work for me since I filter for a variable...

<=$(vCP) doesn't find anything.

 

Thank you in advance!

1 Solution

Accepted Solutions
Or
MVP
MVP

I've tried to replicate what you're doing and I seem to be getting the correct selection, near as I can tell. Note that as a shortcut I've pulled the order month as a direct number instead of grabbing the month from a date, but that shouldn't change anything. What I am a bit suspicious about is that your numbers seem to have a leading 0, so perhaps they're getting treated as text rather than numbers which is breaking the comparison?

Load * INLINE [
OrderMonth
6];

Load * INLINE [
Month
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
];

=Month<=pick(max([OrderMonth]),4,5,6,7,8,9,10,11,12,1,2,3)

Or_0-1636383855959.png

 

I am not aware of any alternative for default selections other than using a dynamic default bookmark, at least in native Qlik Sense.

View solution in original post

4 Replies
Or
MVP
MVP

Have you tried filtering directly on the expression contained within the variable?

=Period<=pick(month(max([Order date])),4,5,6,7,8,9,10,11,12,1,2,3)

 

holymosfet
Contributor III
Contributor III
Author

Yes I tried a lot. None of them gives me a match:

=Period<=pick(month(max([Order date])),4,5,6,7,8,9,10,11,12,1,2,3)
<=pick(month(max([Order date])),4,5,6,7,8,9,10,11,12,1,2,3)
=Period<=$(vCP)
<=$(vCP) / vCP / $('vCP') ...

Is there an alternative to get the same result? This dynamic bookmark thing feels a little clumsy

Or
MVP
MVP

I've tried to replicate what you're doing and I seem to be getting the correct selection, near as I can tell. Note that as a shortcut I've pulled the order month as a direct number instead of grabbing the month from a date, but that shouldn't change anything. What I am a bit suspicious about is that your numbers seem to have a leading 0, so perhaps they're getting treated as text rather than numbers which is breaking the comparison?

Load * INLINE [
OrderMonth
6];

Load * INLINE [
Month
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
];

=Month<=pick(max([OrderMonth]),4,5,6,7,8,9,10,11,12,1,2,3)

Or_0-1636383855959.png

 

I am not aware of any alternative for default selections other than using a dynamic default bookmark, at least in native Qlik Sense.

holymosfet
Contributor III
Contributor III
Author

You made my day!🎉

This was the Problem. Added a field [PeriodNumber] where the period is interpreted as a number. This even works with the mentioned variable dynamically:

=PeriodNumber<=vCP

holymosfet_0-1636389032121.png

Thanks a lot