I am new to qlikview and have a kind of situation where my expressions are having more than 10 nested if conditions, thus charts are taking hell lot of time to open. All ifs' are result of the multiple filters provided in dashboard.
Please suggest me some other way round to decrease the opening time of charts.
It depends on how your ifs are structured. There are other functions such as pick() that can be used together with for example match().
Can you show us how the ifs look like?
1. Use if...else statements in the load script and not in the expression of a chart.
2. See if you could utilize peek(). interval match(), group by functions.
Remember if..else is memory and CPU intensive so you should always use them in the load script and avoid using in expressions whenever possible.
Nested If-statements are sometimes necessary in QlikView- load-scripts, unfortunately.
They are quite difficult to read and very tricky to create and especially to debug.
In the last recent months I had a lot of projects where a tenfold nesting of if-statements was not uncommon.
After struggling with these nested ifs for a while I decided to create a little user-interface which helped me to decrease the time for creating nested if-statements.
Even if this tools is just a little, little helper it may also be helpful for you, so I decided to publish it here:
At the beginning you can define the “fieldname” to be generated” and define your first if-statement:
Let’s assume you are checking the two fields “Age” and “Profession”:
If you want to add an additional if-clause just click on “Add another IF-block”:
As you can see when comparing the two screenshots above the “else-block” of the first statement was removed and replaced by an additional if-clause.
After some further if-blocks the configuration could look like as follows:
Now the last step is easy, change to the “Generated Code” tab and copy your code:
The Tool is offering three different “Formatting Styles”:
If-statements formatted like this were the main-reason for creating this tool
This is my preferred formatting-style for really large if-statements with complex conditions
This is my preferred formatting-style for if-statements with short conditions like demonstrated in this example …
Thanks for your valuable time. It is something like that..
then few more if conditions under each of them.
Conditions are based on user selection.
Please let me know the other way round and I will definetly explore pick and interval match().
But here my problem is something different. I want to avoid Ifs, but as all are getting calculated on the fly bcz of GetFieldSelections(). Is there any way to reduce them ? if yes, thn plz guide me.