Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
AG-gugelbisolutions
Creator II
Creator II

Dynamic multi-value selection and Add Selection to Sheet block

Hi there, I'm trying to generate a multi-page report where each page has its own set of selections. One of the fields to be filtered is "Posting Year-Month" and I dynamically determine its values in my Qlik Sense application's script and set them in a variable which, to be more specific, now contains exactly the following value : "Jan 2025,Feb 2025,Mar 2025,Apr 2025" (quotation marks excluded, but I tried many different configuratons).

The problem is that I cannot find a way to apply these values as selections using "Add Selection to Sheet". I was pretty sure that changing the variable in ("Jan 2025"|"Feb 2025"|"Mar 2025"|"Apr 2025") would have worked but it didn't, so I prefered asking to the community.

Many Thanks

 

 

Labels (3)
5 Replies
marcus_sommer

Selecting multiple field-values with the syntax of: ("value 1"|"value 2") should be working. I suggest you check this manually in the UI against the field. If it's working copy the variable output and apply it also against the field. It's now not working then check the variable output more closely if it's really exact the same as manually written - maybe copying it into an editor like Notepad++ and compare it there against the manual stuff. If the variable output is ok but not working in the selection-action then is there something wrong with the call and needs there an extra quoting or equal-sign respectively the opposite. 

AG-gugelbisolutions
Creator II
Creator II
Author

Thanks @marcus_sommer for the reply and for the advices too, even though they are already part of my daily "practice" and tricks.

I solved the issue by enabling "Raw input" and passing a list of numbers representing the year-month (the first day actually) I need to select. For example

["45292","45323","45352","45383"]

I don't know exactly why a selection of a single value (like "Apr 2025) works, while a multi-value needs to be modified as shown, but it works. 

Thanks

marcus_sommer

Using only pure numbers for all kind of calculations, comparing or matching is in general "best practice" because it avoids all the interpretation/converting-efforts which are often not so obvious and simple as it look like - especially because they are then depending of their context.

This means the same task may require different transformation-statements and syntaxes depending if it's used within a dimension, expression, set statement, variable, action ... whereby the pure numbers are working without any extra efforts everywhere.

Beside using the number of a date from the first day you may also query an appropriate period-information, like:

year(Date) * 100 + month(Date) as Period100,
year(Date) * 12 + month(Date) as Period12

and the Period12 enables also the >= or <= comparing from min/max/current-period - n offset-periods without the need of the advanced date-functions (surely working and useful but also adding complexity).

AG-gugelbisolutions
Creator II
Creator II
Author

Yes, I agree; the only thing I don't understand is why I need to deal with the numbers "behind" the dates in the context of automations while I don't need it in the context of analytics. I was expecting to be able to use the same search string.

Have a nice day 

marcus_sommer

The different tools and their various sub-parts are not a homogenous environment else a patchwork of different programming-languages, frameworks/libraries, developer from different periods against heterogenous requirements and this leads unfortunately to various side-effects ...