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

Run different parts of the script dependent on data from the GUI


Hi,

I have the requirement of building a database in QlikView. That will have certain advantages over the currently used Excel_with_macros database. I know QlikView is basically not a database_tool, but you can do it.

For this, I needed several ways of running (different parts of) the script in dependency of data from the GUI - the user shall be able to use buttons to run parts of the script.

I started out with two - a full reload and a partial reload. Works quite fine.

=> I split the partial_reload_branch into another two by using a binary variable that can be toggled on the GUI (from 1 to -1 and v.v.)

<=> Splitting the full_reload_branch (which is the first one, from_left_to_right) in the same way does not seem possible
        <=> I have two buttons triggering a full reload where the one toggles that variable beforehand (it is reset after the reload)
         <=> Whichever button I press, the code that is in the first branch in the script is always executed, never the second.

=> Can anybody suggest a solution here?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that you are using an action to set the variable. Multiple actions linked to one button press are not always performed in the sequence you might expect. It is possible the the reload is starting before the variable value has changed. I suggest a button(s) that selects the option(s) and a single full reload button.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that you are using an action to set the variable. Multiple actions linked to one button press are not always performed in the sequence you might expect. It is possible the the reload is starting before the variable value has changed. I suggest a button(s) that selects the option(s) and a single full reload button.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
datanibbler
Champion
Champion
Author

Hi,

yes, that is possible. I have noticed before that the order of execution is not always adhered to by the buttons. Strangely, it always worked fine up to now with the partial_reload_branch - but anyway.

I'll think about a way of drawing this apart. That means pressing two buttons in sequence - but okay. Online you sometimes have to press five or six buttons when you have with the first click already stated what you want to do ...

P.S.: I can place the two buttons on top of each other, that way it will be no problem. The first one only toggles the variable and disappears (due to the visibility_condition) and the one under it, which becomes visible only then, then actually triggers the (partial) reload.

The difficult thing about this is that I cannot do these different kinds of reload in the debugger, so I cannot see directly whether the app is really doing what it's supposed to - I can only tell which branch has been executed by using TRACE statements.

datanibbler
Champion
Champion
Author

Hi,

this seems to work.

Now I have four different ways in which I can execute one part of the script. That is the basis for building my database.

I'd love to make this into a document to make it more easily available for other users as a reference guide, but I lack the time to do so.