Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
yogitamehta10
Creator
Creator

Expession changes

Hi,

I have this expression in front end for every chart , now i want to transfer this to backend scripting for better performance

 

if(isnull(avg(if([Measure] = 'E03',[ Weight]))),0,avg(if([Measure] = 'E03',[Weight])))
+
if(isnull(avg(if([Measure] = 'E04',[Weight]))),0,avg(if([Measure] = 'E04',,[Weight])))
+
if(isnull(avg(if([Measure] = 'E05',[Weight]))),0,avg(if([Measure] = 'E05',,[Weight])))
+
if(isnull(avg(if([Measure] = 'E06',[ Weight]))),0,avg(if([Measure] = 'E06',,[Weight])))
+
if(isnull(avg(if([SM Measure] = 'EP07',[ Weight]))),0,avg(if([Measure] = 'EP07',,[Weight])))
+

if(isnull(avg(if([Measure] = 'EP08',[Weight]))),0,avg(if([ Measure] = 'EP08',,[Weight])))

any suggections ?/?

1 Reply
marcus_sommer

With the given information isn't much possible for transfering the calculation into the script but the following expression should be perform a lot better:

rangesum(avg({< [Measure] = {'E03'}>} [Weight]),

avg({< [Measure] = {'E04'}>} [Weight]),

avg({< [Measure] = {'E05'}>} [Weight]),

avg({< [Measure] = {'E06'}>} [Weight]),

avg({< [Measure] = {'E07'}>} [Weight]),

avg({< [Measure] = {'E08'}>} [Weight]))

Range-functions handle each not numeric values with 0 and set analysis is more performant the if-loop.

- Marcus