Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filters works the same way as set analysis?

Hi!,

I have date filters (year, month and day) and indicators that show values depending on the selection on date filters. My problem is that I am having performance problems, I thought that if we just select one day in the filter the indicators will display faster than when I select all years in the filter. Is that assumption correct?

I would like to know please what is the difference between filters and set analysis in terms of internal behaviour. I mean, how do they extract the data from a qvd. Do they evaluate all the data or only part of it?

Thank you!.

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

All data is in memory at all times. When you make a selection in a listbox, the inference engine make a "set" of the associated data. When you then calculate an expression such as sum(Sales), the expression is calculated over the "set" of selected data. So the expression (and the chart) should calculated faster than if no selections are made.

The Set Analysis equivalent is almost the same, except the set of data to be calculated is built on-the-fly.

In both case,  selecting a small subset of the data (such as one day) should calculate significantly faster than when no selections are made.  It sounds like you have a problem in your data model or the way your expression is written. Can you post a sample?

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable
Author

Hi Rob,

Thanks for your response, I have tested with less data and my object takes the same time to evaluate the logic within it, so I am agree with you, I am guessing that perhaps objects in qlikview are not allowed to execute many lines of code.

The object I am using is: indicator

indicator.JPG

The logic is the following:

if(

if(isnull($(vLI($1,'P010','E002'))) and isnull($(vLS($1,'P010','E002'))),0,

if(isnull($(vLI($1,'P010','E002'))),if($(vValor($1,'P010','E002')) <= $(vLS($1,'P010','E002')),0,1),

if(isnull($(vLS($1,'P010','E002'))),if($(vValor($1,'P010','E002')) >= $(vLI($1,'P010','E002')),0,1),

if($(vValor($1,'P010','E002')) >= $(vLI($1,'P010','E002')) and $(vValor($1,'P010','E002')) <= $(vLS($1,'P010','E002')),0,1))))>0 or

if(isnull($(vLI($1,'P010','E003'))) and isnull($(vLS($1,'P010','E003'))),0,

if(isnull($(vLI($1,'P010','E003'))),if($(vValor($1,'P010','E003')) <= $(vLS($1,'P010','E003')),0,1),

if(isnull($(vLS($1,'P010','E003'))),if($(vValor($1,'P010','E003')) >= $(vLI($1,'P010','E003')),0,1),

if($(vValor($1,'P010','E003')) >= $(vLI($1,'P010','E003')) and $(vValor($1,'P010','E003')) <= $(vLS($1,'P010','E003')),0,1))))>0

... (500 more pieces of code silmilar to the 2 showed above)

,1,0)

each piece of code compares variables with limits and in case the value of the variable is out of limits we get "1", if not we get "0".

The problem is that the object takes too much time to refresh the result. I am using "or" operator to join the pieces of code because if nested takes even more time to refresh the object.

Is there a limit of lines of code that an object ("indicator") can execute in order to avoid performance problems?  ...because when i separate the lines of code in more indicators, they are refreshed significantly faster that when i use only one object.

Any idea will be great. Thank you.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think there are specific limits on nested if(), but I can say that 500 or more nested if() is probably the wrong way to go about this in QV.  Note that QV will execute every piece of this every time.

What is the $1 in the expression represent?