Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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?

10 Replies
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