Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arieidel
Partner - Creator II
Partner - Creator II

Looping through sets of filters, apply them and persist result

Hello,

Suppose I have a database table like this:

SetOfFiltersFilters
Set1Atr1=Val1,Val2,Val3;Atr2=Val6
Set2Atr4=Val*;Atr5=Atr5<1000
Set3Atr6=4

Every row has a set of filters, like a Bookmark. Those filters correspond to a QVW app. If I apply them on my app I get a result. From that result, what I want is the possible values of a specific attribute: AtrX. I would like to persist to a CSV file (or database if it's possible) the possible values of AtrX after each set of filters is applied.

I think I have to make a process to:

1. Open that table

2. Read the first set of filers

3. Open my qvw app

4. Apply the filters

5. Save the result (possible values of attribute AtrX) in a CSV file or database

6. Repeat the steps with the rest of the Sets of filters.

I can do those steps separated and manually but I don't know how to integrate the whole logic into a single automatic process.

Any idea?

Thanks!

2 Replies
jonasheisterkam
Partner - Creator III
Partner - Creator III

If you create the automation in a QV-Client, you can do all the steps in a macro. With VB-Script you can use SQL, set selections and export. You can find a API QVW in the QV 11 sdk and for  SQL in VBS use google and search in Community.

Or if you want click nothing you can build it completely in QV-Script and use resident load with where instead of selections.

arieidel
Partner - Creator II
Partner - Creator II
Author

Hi Jonas, thanks for your answer.

I would like to schedule the process in Publisher. I think a VBScript macro will work in "batch mode" only after the qvw reloads so the export could me made only once. I mean, when de QVW reload, I read the set of filters. Then, after reload, I select (apply) the filters and export the result. But now I would like to read the next set of filters. How can I iterate through all of them?