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

Performance help


QuarterYear,HalfYear,MYear and Year fields are from calendar table.
SelectionPeriod is a data island for period selection(created for drop down listbox)

I used the following as calculated dimension in most of the charts,
=if([SelectionPeriod]='Quarter',QuarterYear,
if([SelectionPeriod]='Half Year',HalfYear,
if([SelectionPeriod]='Year to Date',MYear,
if([SelectionPeriod]='Full Year', Year))))

I suspect this may cause performance issue, Can anyone suggest how can i replace either in the script or as set analysis or in the variable?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes, a data island with the if() could be a significant performance problem. A couple of solutions:

Option 1. Create a variable named vChoosePeriod and move the if() there. It should return a String of the fieldname and be defined with a leading "="/

=if([SelectionPeriod]='Quarter','QuarterYear',

if([SelectionPeriod]='Half Year','HalfYear',

if([SelectionPeriod]='Year to Date','MYear',

if([SelectionPeriod]='Full Year', 'Year'))))

Then your calculated Dim is:

=vChoosePeriod

Option 2. Link the UI Selection to the Calendar fieldname:

UI_Period:

LOAD * INLINE [

SelectionPeriod, SelectionField

Quarter,QuarterYear

Half Year,HalfYear

Year to Date,MYear,

];

Then your calculated Dim is:

=$(=SelectionField)

For more, see

How to Choose an Expression | Qlikview Cookbook

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

10 Replies
SreeniJD
Specialist
Specialist

Instead of nested IFs, use If(Match(SelectionPeriod]=('Quarter','Half Year','Year to Date','Full Year'),...................)

HTH

Sreeni

gauthamchilled
Creator
Creator
Author

Sreeni,

I already tried, I don't see a much improvement in performance between match and nested if. Any other suggestions or help from anyone?

SreeniJD
Specialist
Specialist

You might use Pick(WildMatch()) as well to improve performance... Just try that

Hope this will help

Sreeni

qlikviewwizard
Master II
Master II

Hi,

Try like this in script:

LOAD *,

if(wildmatch([SelectionPeriod],'Quarter') >=1 ,QuarterYear,

if(wildmatch([SelectionPeriod],'Half Year') >=1 ,HalfYear,

if(wildmatch([SelectionPeriod],'Year to Date') >=1 ,MYear,

if(wildmatch([SelectionPeriod],'Full Year') >=1 ,Year))));


Data:

Your script;

settu_periasamy
Master III
Master III

Hi Gautham,

May be you can try with "Enable Conditional". Like Instead of Calculated Dimension, Put Your needed fields in Dimension, Then you can enable it based on your Selection Period. 

Capture.JPG

gauthamchilled
Creator
Creator
Author

Thanks for all your responses. Is there any way that I can handle this in script?

jonathandienst
Partner - Champion III
Partner - Champion III

That dimension should not cause significant performance problems as it does not need to be calculated on a row by row basis.There should be no reason to handle this in script.

That said, I would do this with a cyclic dimension -- From the Dimension tab (or Document Properties), click Groups, and add a cyclic group containing the fields in your dimension expression and use the cyclic as the chart/table dimension.

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

Did you try my logic?

jagan
Luminary Alumni
Luminary Alumni

Hi Gautam,

Do you have performance issues only in this particular chart or overall dashboard?  I think this expression won't have performance issues.  What is the volume of the data?  What is the size of Qlikview file?

You can also try Cyclic Groups or Enable conditional options, did you tried that?

Regards,

Jagan.