
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add Sheet or Report Selection Based on Variable Values
Hello everyone,
I hope this post finds you well. I am writing to you mainly because I need some help with an automation I am currently working on. Having said that, I have a Qlik table with some segments, each of which has a unique limit that cannot be exceeded. Therefore, I have already isolated the values that are over the limit with an IF block. Then, I stored them in a variable. Finally, I would like to send a PDF report, but using those values from the variable as selections to filter out the data in the sheet that will be sent as PDF. So far, my idea has not worked, I am getting one page per value and one page with all the values.
This is how I am trying to use the variable values as filters.
Is there any other way to make this work?
Thanks a lot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure you clicked the value itself and not the label of the variable field?
If you click the field name in the loop I think it won't work, you have to click the value displayed in the output window of the variable. The values are added like a "dictionary" so you must point out for the value to loop, instead of the field name.
And if I understand it right, if you're passing all of the values to the variable, the variable list is the one that should be looped, otherwise you'll be passing all of the values again in each loop.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do something similar, although it has other steps, the filtering part is basically the same logic:
I load and loop the values I want to apply as filters from an app field and by each iteration I add a new sheet to the report before I generate it, so it gives me a pdf with multiple pages. Note that I select the Q Text from the field I looped, and not the name of the field. The ApplyBook is just to get the year and month that I apply, but the third selection is based on List Values of Field 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer. In the variable, I store the IDs that fulfil my criteria. There are more IDs, but those are the ones that exceed the limit. In the app, there is a field called idRule which is the one I would like to use as a filter for my report., but with only the values I isolated before.
I was doing this to filter out the values since the variable has all the values I need, but I am not getting the result I was hoping for.
I would try the list values of the field and I would match the column with the values stored in the variable.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you have to loop the variable list of values you added from the Get Straight Table Data. As I can understand from the picture, you're looping the Get Straight Table Data instead and passing the values to the variable as a list.
Actually, I think you don't even need a variable if you're pulling the data from the table that already holds the ids you need. Just make sure the table has the ids filtered (using expressions in the app) and then pull these values from Get Straight Table Data and loop each value adding it to the sheet selection on each iteration.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again,
And yes, I am using a table to make the validation; more like a template to be honest, but it holds all the IDs; the ones that exceed the rule and the ones that do not. For this reason, the variable helps me to fetch only those who exceed. Based on those values, I wanted to use them as filters to send a single-page report with another table that will be filtered based on those IDs that exceed the limit and which are stored in the variable. I am still trying, though.
Thanks again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. You could try filtering the values in the table itself, it could be a dummy sheet just to filter only the values you need. Then you point out to the table and you won't need a variable.
2. If you want to use the variable, then check if the variable is receiving a single value or a list of values. If you're passing a single value from the table to the variable, then you must loop the table and point the value (not the field header) in the field parameter of the variable (where you specify what to be added to the variable). This works like the following: The table will iterate each of the values it holds and the variable will receive a single value on each iteration. (This is actually redundant because you could loop the table directly and add the selection with a condition block)
The second approach would be passing all of the values to the variable and you'll have a list of values. Then you must loop the variable list and not the table. The table will be outside the loop (together with the IF block) and each iteration will go through each value of the list, that were filtered with your IF block.
In either way I don't think you need a variable, just to loop the table and use the if block condition to add the id to the sheet. If the ID is not one of the desired, the loop will go through to the next ID without adding the selection or generating the report.
