Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Bhavani
New Contributor II

Pass filter value to Data load script in Qlik Sense

Hi All,

Is there a way where a filter value could be passed to data load script ?

I have tried using GetFieldSelections and other functions but they are not getting values passed rather passing the function as is.

Also , tried assigning the evaluated value to another variable but that also showing the function as is.

Thanks

5 Replies
Highlighted
lanlizgu
Contributor III

Re: Pass filter value to Data load script in Qlik Sense

What you can do is:

  1. Declare a variable in the script set vVariable=GetFieldSelections(FieldToFilter); 
  2. Add a Navigation & Actions Button in the App and set a variable value
    1. variablename:  vVariable2
    2. Value:                  =$(vVariable)            
  3. You would need to create a partial reload button and add the following to the script:

    1. Variable:
      add Load
      '$(vVariable2)' as Variable
      autogenerate (1);


      VariablebyLine:
      ADD LOAD
      subfield(purgechar(Variable, chr(10)),',',$(i)) as Variable_NUMBER
      RESIDENT Variable
      Where Len(subfield(purgechar(Variable, chr(10)),',',$(i)))>0;

      NEXT

  4. In that way you would obtain the specific filter that you are doing inside the script
Highlighted
Bhavani
New Contributor II

Re: Pass filter value to Data load script in Qlik Sense

Hi lanlizgu ,

Many Thanks for your suggestion.

I have tried the steps given by you. But,I am unable to get the field selected value to data load editor script.

Can you please share a qvf for this?

Thanks,

Bhavani

Highlighted
lanlizgu
Contributor III

Re: Pass filter value to Data load script in Qlik Sense

Please find attached a QVF that will store in a variable the selection done in a field (just select 1 value, for more values you would need to develop as mentioned):

  1. You select 1 year
  2. You click on My Button
  3. You Click on Validar
  4. Once the partial reload is done you will see in the vVariable2 variable the selected year

 

You need to have the reload_partial extension and Navigation & Actions installed

Highlighted
Bhavani
New Contributor II

Re: Pass filter value to Data load script in Qlik Sense

The extensions holders in the app says invalid visualization inspite of having the extensions in place.

Do I have to select any navigation action ? or should it be none.?

Highlighted
lanlizgu
Contributor III

Re: Pass filter value to Data load script in Qlik Sense

You can't see none of the extensions?

 

for the Navigation + Actions

https://github.com/stefanwalther/sense-navigation

PFA the reload partial extension