Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?/? |
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