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

Trigger - Select Filed Values not bringing exact values

Hi guys, I don't know if you have faced this issue before.

In a specific report, I dinamically select weeks in a filter, using Trigger - Select in Field.

I'm using a variable to bring last 13 weeks, starting with current week.

We are in Week 9, but it's bringing week 10 and 11. I found out why this is happening.

I've checked the variable and it's not bringing '2021-10' and '2021-11' there, but it's bringing '2021-1'.

The field selection is automatically assuming that it needs to select all values starting with '2021-1'.

A way to fix it would be to use 2 digit week number, but I'd need to change in several places. Can you tell me if it's possible to select only the exact values and not similar ones?

tks.

Labels (1)
5 Replies
edwin
Master II
Master II

that is how selection in qlikview works - it will look for all values that will satisfy your selection pattern - as youve observed 2021-1 will include 2021-1, 2021-10, and 2021-11 (i think it will also include 2021-12 up to 2021-19)

if you want it to be specific then you have to make your selection specific.  maybe you need to put in the time so that jan is distinguished from other months

marcus_sommer

2 digit week number wouldn't be enough at least not without additionally logic because you wouldn't fetch with it the turn of years. More suitable in such cases is to create a consecutive week-counter, for example with:

autonumber(Year & '|' & Week) as WeekXXX

within the master-calendar. In general it's recommended to use for all matchings and calculations numeric values and not strings.

Depending on your use-case it may be even easier to create appropriate flag-fields within the script which could be used for selections and/or as conditions within set analysis.

And yes, I suggest to go the painful way and to change this everywhere - and each similar scenario, too. In the end it saves a lot of time instead of solving such challenges within the UI which are better solved within the script.

- Marcus

edwin
Master II
Master II

the format he is using for week is YYYY-WW

edwin
Master II
Master II

actually its YYYY-W, so year is already included

marcus_sommer

But it seems not be a number - at least not unique one. I don't want to say that's not possible to calculate with such values but it's far not so easy as with the mentioned consecutive number which might be used, like:

>=max(WeekNumber)-13<=max(WeekNumber)

maybe better applied on a listbox and stored within a bookmark instead of using actions.

Are there more similar date-ranges appropriate flags and/or an as-of-table may simplify the entire approach further.

- Marcus