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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out 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 (3)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

May be this

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