Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clear Field action not working on button with multiple actions

I have a button that does a Select in Field action using a concat command with a set analysis. To make sure it runs correctly, I'm trying to have the button run a Clear Field action before the Select in Field, but the Clear Field doesn't seem to work. Has anyone run into this before?

8 Replies
avinashelite

Hi Spencer,

I tired its working fine, can please post your app or expression. Lets have a check

stigchel
Partner - Master
Partner - Master

You cannot depend on the order in which actions are run, in fact I believe that all actions are performed on the state before any of the actions took place. You could try to have one action on the button, clear field and add a field event trigger on that field that will select the Concat outcome.

Not applicable
Author

Hi Avinash,

I'm not sure how to attach a file to a post (sorry, new to the site), so the concat function I'm using is:

='('&

Concat(

{(($

-

<[Store Open YearWeek]={'*'}>)

+

<[Store Open YearWeek]={"<$(=min(Week)-100)"}>)

*

(($

-

<[Store Close YearWeek]={'*'}>)

+

<[Store Close YearWeek]={">$(=max(Week))"}>)

}

[Store Number], '|')

& ')'

The select in field is working, because it will narrow the selection field when a finer selection is appropriate, but it can only select Store Numbers that are actually in the current selections, which leads me to believe that the clear field isn't working.

Thanks!

Spence

Not applicable
Author

So order of actions has no effect when there are multiple actions? I can verify that the select in field is running again, as my selection change as the affecting variables change, but it only selects within the previous selections, so the clear selections button must not be working.

I can't tie a trigger to the field as there are other reasons that field gets used, but maybe I could add a variable whose sole purpose is to be changed and cause a trigger.

Thanks for the help!

stigchel
Partner - Master
Partner - Master

Indeed, Order of actions have no effect when there are multiple actions.

What I sometimes do when some selections get in the way of each other is use a data island (the same selections loaded again but not linked to the data) because then you can be sure that you can always select a value. In the relevant expressions you then use a set expression linking the selection to your data {<Data={'$(=MySelection)'}>}

Not applicable
Author

Thanks for the suggestion.  I ended up just forcing the user to clear the field before making another selection which seems effective.  It just occurred to me that there should be a way within set analysis to ignore the current selections of a field, but my scripting knowledge isn't advanced enough to get that to work yet, and it's already a fairly complicated equation, so I'll just leave it this way.  It also has the added bonus of telling a user that their selections are being changed so that they don't have something changed without their knowledge.

Thanks for the help though!

stigchel
Partner - Master
Partner - Master

There is a way of ignoring field selections in set analysis, the syntax is simple

{<Field1=,Field2=>}

Selections in Field1 and Field2 are ignored using this set expression

Note that this is not the same as

{<Field1={'*'},Field2={'*'}>}

Which means all values in Field1, Field2 , which theoratically excludes values in e.g. Field3

Not applicable
Author

The field I needed to ignore the selection on is the field I'm doing the limiting on, so, after some research, the {1} operator should have been worked for it (as opposed to {$}.  All it did though was cause you to have to hit the button twice though - the first time it undoes the current selection and selects all possible, the second time it selects the correct set.  This would be even more confusing for the user, so I'm just forcing them to clear it.