Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Action to Clear Field not working

Hi,

I am trying to use the Clear Field Action to clear the filter of one list box selection as another list box selection is chosen. However, it just doesn't work!

I have a second action to set a variable that is working, so I know the actions are being called but no joy with the clear field happening. I've tried some of the other actions which have the same problem. Only "Clear All Selections" appears to work, but I have many other selections going on that I don't want to touch.

Does anyone have any ideas why this is action is not working? The list boxes are just holding different year selections based on the same data (one list box for Financial Year, one for Calendar Year and so on).

Thanks
Nick

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens


Nick Swift wrote:I really need a "on Selection" event instead of trying to use the "On Activate" event, but I don't think there is anything like that is there?


There is, but not in the sheet properties. Go instead to the Settings menu, Document properties, Triggers. There you can set actions (which may run macros) On Select or On Change.

What you are doing now is firing those triggers every time you click on that tab and it's not active, that is when you change to another sheet and then go back to this one.

In the Document Properties you can select the field you ware going to select and set the actions to use on select.

Hope that helps.

View solution in original post

10 Replies
Not applicable
Author

Hello,

You can try with a macro like that,

ActiveDocument.Fields(

"Field_Name").Clear





Not applicable
Author

Thanks, it nearly works....but not quite.

It's now clearing the other selection field which is great. But it then continues to clear itself!? I've called the macro from the activate event of the financial selection box I have - is this correct?

It's not clearing or affecting any other selections, so I can't see how it's managing to clear itself?

boorgura
Specialist
Specialist

if you are on SR3 or later, yes you will have an action to clear field.

But, for that to appear on the list, you will have to enable it.

Goto "Help" --> "About Qlikview" in QV. right click on the "Q" symbol on the left bottom side.

Its pops up a settings box.

Set the value for "ExtendedActionsSR3" to 1.

Then you will see the action "Clear Field"

Let me know if you have any questions.

Not applicable
Author

Hi,

I have done this and tried to use the Clear Field action - but it just doesn't work and does nothing. I'm on 9 SR6 by the way.

boorgura
Specialist
Specialist

Strange - I use the clear Field Action and works fine for me.

Can you please send a screen shot of the action/trigger?

Not applicable
Author

Here it is. The two fields in question are top-right, the "By Calendar Year" (LB13) and "By Financial Year" (LB44). So I want to clear any selection in LB13 when LB44 has a selection.

By the way, the Run Macro in there is trying to do it via a Macro (see thread above).

boorgura
Specialist
Specialist

It should not be LB13.

It should be the Field Name.

Not applicable
Author

Thanks, of course. I was using the object id by mistake.

I just cannot get these actions to work for me though. No matter how I try and do this, the events just seem to fire off at the wrong times. Just by switching sheets for example it appears to be firing object activate events which I don't want it to do.

I really need a "on Selection" event instead of trying to use the "On Activate" event, but I don't think there is anything like that is there?

Thanks for your help

Nick

Miguel_Angel_Baeyens


Nick Swift wrote:I really need a "on Selection" event instead of trying to use the "On Activate" event, but I don't think there is anything like that is there?


There is, but not in the sheet properties. Go instead to the Settings menu, Document properties, Triggers. There you can set actions (which may run macros) On Select or On Change.

What you are doing now is firing those triggers every time you click on that tab and it's not active, that is when you change to another sheet and then go back to this one.

In the Document Properties you can select the field you ware going to select and set the actions to use on select.

Hope that helps.