Qlik Community

Ask a Question

App Development

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

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Bhavani
Contributor II
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
lanlizgu
Creator III
Creator III

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
Bhavani
Contributor II
Contributor II
Author

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

lanlizgu
Creator III
Creator III

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

Bhavani
Contributor II
Contributor II
Author

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.?

lanlizgu
Creator III
Creator III

You can't see none of the extensions?

 

for the Navigation + Actions

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

PFA the reload partial extension