Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Creator III
Creator III

Actions and variables, what's happening ?

Hello,

I'm using Qlikview 11.2 SR12. It's not the greatest version and maybe I will have to upgrade because I think I have a bug about actions and variables.

I want a button to remove all filters except 1 if it is already selected.

So my idea is to make a button with

  • set a variable to the value of getfieldselections
  • clear all
  • select the field with the value of my variable

The problem is that it seems Qlikview only update the variable value when all the actions have been completed.

In my selection of Company,

If I select the Company1, it will end with everything cleared and Company1 in the variable.

But after that, if I select Company2 and press the button, it will clear all, select Company1 (because it was in the variable) and then put Company2 in the variable, even if the Set Variable was the first action.

Look at the example provided.

Is there an error in my code ?   is there a walkaround or do you know if another SP of 11.2 fixes that ?

Thanks

1 Solution

Accepted Solutions
brian554xx
Contributor III
Contributor III

If the objective is to clear everything except a particular field (which I call "preservefield"):

  • Unlock all
  • Lock preservefield
  • Clear all
  • Unlock preservefield

If you must also preserve the already-locked fields, add this in the script:

Set HiddenPrefix = '_'; // or whatever you like

Preservation_Island:
NoConcatenate
LOAD Distinct
  preservefield,
  preservefield as _shadowfield
Resident Table_With_Preservefield;

In the button actions:

  • Select possible _shadowfield
  • Lock _shadowfield
  • Clear all
  • Select possible preservefield
  • Unlock _shadowfield
  • Clear _shadowfield

Let me know if that works for you!

View solution in original post

12 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

The actions in qlikview won't be executed seriell. This meant you couldn't get a stable solution with a chain of actions if they are depending on eachother in any way. Perhaps you need another usability with multiple buttons and/or back/forward-buttons or bookmark-actions or something similar. Maybe also this is helpful for you: Tracking the historical selections.

- Marcus

lironbaram
Partner
Partner

hi

some of the actions in Qlikview take time to update and there for when applying several actions

you'll need to include a macro that do a sleep function

but the good news you don't need this sequence , just use the action clear other fields

that clears all the fields except to the field you set

fredericvillemi
Creator III
Creator III
Author

I still take that as a bug : a succession of Clear and Select always work fine. But setting a variable seem to happen only when the action list is over. Too bad.

Clear other fields is nice but if you have selected nothing, it will select All .. I don't like that .. I want to clear other, not clear other and select all !!  Again I would say it's a bug.

fredericvillemi
Creator III
Creator III
Author

Thanks for your very interesting link.

I still think my problem could be easily fixed (and is some kind of a bug) : all actions of selecting and clearing are sequential. Too bad the Set Variable is not and only occurs when the actions are over.

I have fixed my issue with the tip of another article : locking the Company field, clearing everything and unlocking the Company.  It adds a lock/unlock to the history of filters but it's the better way to do I think

brian554xx
Contributor III
Contributor III

If the objective is to clear everything except a particular field (which I call "preservefield"):

  • Unlock all
  • Lock preservefield
  • Clear all
  • Unlock preservefield

If you must also preserve the already-locked fields, add this in the script:

Set HiddenPrefix = '_'; // or whatever you like

Preservation_Island:
NoConcatenate
LOAD Distinct
  preservefield,
  preservefield as _shadowfield
Resident Table_With_Preservefield;

In the button actions:

  • Select possible _shadowfield
  • Lock _shadowfield
  • Clear all
  • Select possible preservefield
  • Unlock _shadowfield
  • Clear _shadowfield

Let me know if that works for you!

View solution in original post

fredericvillemi
Creator III
Creator III
Author

Thanks, yes I have done this way (without the code to preserve the locked fields but it is ok for me)

I'm just unhappy about the fact Actions and triggers are not really sequential in Qlikview but I'll do with it

Thanks

trailblazer070
Creator
Creator

Hi Frederic Villemin,

Do Actions work on Ajax browser when published.

I have a few Red Green Amber Text objects and have Actions on them to " select in fields Action " to filter out a table beneath it. Will these Select In field Actions of these text boxes work in Ajax browser. Basically will Actions work in Ajax browser. Please kindly let me know. This would be really helpful! Thanks in advance!

trailblazer070
Creator
Creator

Hi Marcus Sommer,

How are you? I have a question.

Do Actions work on Ajax browser when published.

I have a few Red Green Amber Text objects and have Actions on them to " select in fields Action " to filter out a table beneath it. Will these Select In field Actions of these text boxes work in Ajax browser. Basically will Actions work in Ajax browser. Please kindly let me know. This would be really helpful! Thanks in advance!

trailblazer070
Creator
Creator

Hi Brian Schiefen, I have a Question on Actions :

Do Actions work on Ajax browser when published.

I have a few Red Green Amber Text objects and have Actions on them to " select in fields Action " to filter out a table beneath it. Will these Select In field Actions of these text boxes work in Ajax browser. Basically will Actions work in Ajax browser. Please kindly let me know. This would be really helpful! Thanks in advance!