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: 
sathish_kumar
Contributor II
Contributor II

Optimize expression

Hello Users,

Is there any way to optimize the below sum if /set analysis expression

The below expression works well in charts... need to replace with an optimized expression which consumes less RAM .

Is there any way you can fine tune below expression?

sum({<Date*={">$(vStart)<$(vEnd)"}>}Sales* if((1-(fabs(Sales-Estimate))/Sales)<0,0,(1-(fabs(Sales-Estimate))/Sales)))/sum({<Date*={">$(vStart)<$(vEnd)"}>} Sales)

 

I dont want to do it in scripts... so prefer it in expressions. So can someone help me with this...

@sunny_talwar 

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum({<Date*={">$(vStart)<$(vEnd)"}>}Sales * RangeMax((1-(fabs(Sales-Estimate))/Sales), 0))
/
Sum({<Date*={">$(vStart)<$(vEnd)"}>} Sales)

View solution in original post

1 Reply
sunny_talwar

May be this

Sum({<Date*={">$(vStart)<$(vEnd)"}>}Sales * RangeMax((1-(fabs(Sales-Estimate))/Sales), 0))
/
Sum({<Date*={">$(vStart)<$(vEnd)"}>} Sales)