Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone
The users of my QlikView application are examining the chance of using QlikView to do simulations for What-If scenarios. For one particular application in shipping, users want to be able to change the estimated spending field for various expenses and to see how these revisions affect the budget.
I have experimented a couple of times with an input box but it seems like one must use inputfield when loading in the script. As my script is reloaded every evening, I am unsure as to how to handle an inputfield in a table as the row numbers are changing all the time. My table has fields like:
_KEY, G/L account, Estimated spending, Budget, Actual
My solution would call for inserting an inputfield called "Estimated spending revised" which can be used as a basis for calculating other information and trust to the unique key to keep track of an input field.
Does anyone have experience or am developing apps with inputfields or simulations?
How about declaring variables that are tied to input boxes? The variables could be preset with default values and the user simply changes them to see the effects where the variable contents are used in expressions in a pivot table, for example.
Regards,
Gordon
Hi Gordon
I have about 30 G/L accounts which would require input boxes then. hmm, I think I should try that out and see how it works. Have you scripted inputfields in any of your applications?
Yes, I use it in a couple of documents. For example for a user to test the effects on margins if rates were to change (and also to condition text colors etc). In the expression, a variable such as vRate is simply referred to as vRate (no bracketing or $ signs required.
Regards,
Gordon
Jeanne,
I have some experience with inputfields and simulations. Your concern about new records coming in all the time is absolutely correct.
I'm trying to position my "Simulation" functionality as "play and discard", for that same reason. If you have to keep the entered values for long periods of time, you need to do one of the following:
1. Either ensure that your data is loaded with chronological order - newer rows are always appended at the end and no deletions are allowed ( I know, this is pretty hard to do).
2. Or, try to extract the entered values into an external text file and apply saved values during the reload. Yiou can extract inputfield values using macros.
good luck!
Hi Oleg and Gordon
Your advice has been very helpful. Luckily, the inputfield data is strictly for simulation and can be discarded as we do not have much control about how new data is loaded.
Do any of you have a simulation script you can load as an example? Thanks!
Hi Jeanne,
I've done a budget application, were I had the same issue with assosiating the loaded values correctly. Our solutions was simply to write them down, and then reread (and reset) when reloading.
So the user enter some values, when he is done, he presses save. Save uses a macro to generate a csv containing the new data set (I added a datestamp to the name, so I had the history).
Then when reloading, you load the newest file, and reset the values in your input fields (there was some trick here with the reset, that I can't remember). And voila you have the adjusted numbers.
Hope I understood you right 🙂
Torben, how did you reset the input fields during reload? A macro activated on reload doesn't work on the server.
/Maja
Dear Maja,InputField are reset automatically during reload.
Inputfield is a property of a field. Default value for the field is set during the reload...
I guess what Torben said is that saving the inputfield in a csv file was used to retrieve the previously updated values.
Rgds,
Sébastien
My inputfields does not reset automatically during reload. I have confirmed in several posts in the forum that inputfields survive reload. So my question is how do I reset them without using a macro? I have QlikView 8.5