Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger on clear?

Working in QlikView, I realizaed there is no trigger on clear button.. For example if you want to give variable, specific value, on clear, it isn't possbile.. The only way is to create button that will do clear through macro..

Am I right or wrong?

Tnx.

14 Replies
disqr_rm
Partner
Partner

See enclosed.

Not applicable
Author


Rakesh wrote:
See enclosed. <div></div>


Hi Rakesh,

I have tried your solution (in QlikView 9) ...

Unfotunately it does not work and I do not understand your idea to solve this issue ...

Best regards

Stefan

Not applicable
Author

I wonder if this is an 8.5 solution. You can fix Rakesh's solution to work with version 9 by changing the OnChange trigger for field "a" to be an OnSelect trigger instead.

It seems that on a Clear, the OnChange isn't fired, but the onSelect is.

I think in order for this to work in a real application (more than one field to clear), then the trigger would need to be placed on the OnAnySelect event and every field would need to be checked to have 0 selections. I'm guessing you could use a loop to loop through all fields in the document and check for selections rather than hardcoding it for each.

Unfortunately, this is the best we have until we get some more trigger events.

biester
Specialist
Specialist

I'd say: clear is a special form of Select ("Select NOTHING"), and there ARE triggers for OnSelect and OnAnySelect. But perhaps I'm misunderstanding something.

Rgds,
Joachim

disqr_rm
Partner
Partner

Yes, unfortunately I only have 8.2 installed on the machine I have right now. I can make one example in v9 tonight when I get home.

The idea is to have a field (in this case field "a") with more than one records (in this case I loaded 2 records). Then a macro on "On Open" will select one record. Then a macro on "On Change" for this field will check if no records are selected, this will only happen if user presses clear button. Then the message pops-up and next line in the macro selects one record again. Same cycle....

Hope this makes sense.

Not applicable
Author

Oh, now I see. That's a pretty clever way to do it.

I just figured "a" was a dummy field and ignored that part. This is a great example of taking what the program gives you and adding functionality that wouldn't otherwise be available.

In order to make this work in version 9, add the IsClear macro to the OnSelect for "a" (it can be removed from the OnChange).

Not applicable
Author


biester wrote:
I'd say: clear is a special form of Select ("Select NOTHING"), and there ARE triggers for OnSelect and OnAnySelect. But perhaps I'm misunderstanding something.
Rgds,
Joachim<div></div>


Oh, I've not seen the trigger ... so nice idea and it works!! Thanks for your "additional" explanation ... 🙂

Best regards

Stefan

disqr_rm
Partner
Partner

Glad to see that I have added some value here 🙂

Hi Vrbcic, Were you able to make it work for you?

Not applicable
Author

It is realy funny, when I posted this question to forum, I alredy tried to connect clear macro with OnChange trigger, and this solution didn't work for my case. But now I tried in a simple application and it is working..

So it is a problem with my application, and I don't know why.. Some bug is around 🙂