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

How to make the default clear all button clear variables; without using macros

Hi, I'm slogging around mostly not answered or half-related posts looking for a way to make the Clear All button itself clear variable input boxes and not just the list boxes.  Because Qlikview Management Console on the Qlikview server doesn't let us schedule automated reloads on qlikviews containing Macros, I need an angle to add something to the list of default Document Event Triggers listed under Settings->Document Properties: Triggers..

The default document event triggers are the four items:

OnAnySelect

OnOpen

OnPostReduceData

OnReload

I want Document Event Trigger that says OnClearAll that then lets me Add Action->External->Set Variable and maybe write a bunch of these actions to have it set each variable to blank (or '' or Null()).

If I must, I'll go with a textbox button or maybe check with people whether OnOpen or some other document/sheet event like that would be good to clear the variables.  Really hoping I can get the Clear All button we already have to Clear All though.  Making a clear variables button feels eerily like making a virtual backspace key...

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

I think I have made some kind of working example of this (see attached), all be it that you need to add each clear variable action

What I do is:

-load a seperate field Clear with value Clear

-This field has a trigger to clear a variable and set the value of Clear to Clear again

The Clear all from the toolbar triggers the trigger on Clear, which in turn clears the variable

View solution in original post

22 Replies
vgutkovsky
Master II
Master II

Hi, Steve. That's not possible--the Clear button that is part of QlikView clears field selections, and not variables. I typically create (as you suggested) a text object that clears selections and sets variables back to default values. The OnAnySelect trigger doesn't fire when you press the built-in QlikView clear button, so you couldn't use that. I usually train my users to use the text object button and not the built-in button. In some cases, I even hide the AJAX or IE Plugin toolbar entirely.

Vlad

Anonymous
Not applicable

Hi,

I don't think there is anyway to do that with variables without using macro. You could clear each variable with a separate action or try instead of using variables creating your variable values in script as separate dataislands. Selections on these fields would then also be cleared with the clear all action.

Best regards

Stefan

stevelord
Specialist
Specialist
Author

The data islands idea to stuff the variables into fields is clever and I will keep that in my brain.  However, the variables in this case can be pretty much any number anyone feels like entering (they relate to goals, be it the number of steps or minutes logged, or the number of times logged, weight loss, actual weight, etc. )

Thanks for the input though, that is a clever trick I'll add to my arsenal.

rustyfishbones
Master II
Master II

Hi Steve,

I have files automatically reloading in the Management Console and I have lots of Macros and it works fine

Regards

Alan

stevelord
Specialist
Specialist
Author

Thanks, hide the toolbar and make my own toolbar is probably the approach I'll be saddled with.  Sorry there's no way to do what is desirable, but helpful answer points all around. (Not as hopeless as getting a functional logout button at least. )

stevelord
Specialist
Specialist
Author

Thanks, I'll re-visit that.  We had an issue where we were trying to make our qlikviews export reports to excel when they refreshed themselves, and we couldn't use the 'store into' bit in script for that, so we tried macros.  Subsequently, the qlikviews refused to refresh themselves, and people said it was because of the macros.  They ended up pointing us to nPrint or windows task scheduler, but they were either unwieldy or qlikview server fought them someway.

It was awhile ago, but maybe the qlikviews were refreshing and just not the macros being run on the scheduler.  If that's the case, then we might be okay with the macro route since people pushing a clear all button isn't anything we need to run through the qvmc scheduler.

I'll try it out and hand off a correct answer if it works, since I'm out of helpful answers now.

stevelord
Specialist
Specialist
Author

Can one of you all let me know how I might modify the macro in this post to work with input boxes that don't have predefined values?

Reset input box using macro on Clear All button

Correct answer there is for predefined value input boxes, and it was posted in 2012, so not sure anyone there will reply to my followup.

vgutkovsky
Master II
Master II

Btw, I'm not so sure a Logout button is an impossible as you think. Take a look at the attached--just put it together. This will let you log out, as long as you have Login authentication enabled in the QMC. Copy the htm file to C:\Program Files\QlikView\Web and put the QVW anywhere in your User Documents directory structure. I think that's going to be my next blog post 🙂

Vlad

stevelord
Specialist
Specialist
Author

Ah, that's funny.  I will put this logout button to the test too.  I had a theory it'd need to be some action to kick people to somewhere that makes them have to re-authenticate to get back in; 'a custom web page of some sort' I said, and it looks like you setup something like that.  (I had the same idea, just lacking the skill set you seem to have. )

We need a logout button that works with Authenticate-Always, and makes it so when people push the button they can't get back in by any means unless they re-enter their login and password.  Qlikview has a logout button that appears when you set authentication one step below 'always', but people can just wander back into the qvw without having to log back in.  People sharing terminals or using multiple credentials need the logout button to actually logout without them needing to close out their whole browser.