Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
We managed a cumulative line chart having month as dimension with two growing % of actual and %plan progress. The charts works perfect with rangesum function but users request is to have the chart keep the full value even when a particular month range is filtered. By default, the rangesum recalculates the values based on selection and this makes the figures go wrong. What is required is just a snapshot/zoomed view of the original chart(without any selections).
Dimension: Universal.MonthYear
Measure1(Plan):
IF(if(Sum( {$<DateType={'Plan'}>} [Plan Weightage])=0,null(),Sum( {$<DateType={'Plan'}>} [Plan Weightage])) = 0, 0,
rangesum(above(if(Sum( {$<DateType={'Plan'}>} [Plan Weightage])=0,null(),Sum( {$<DateType={'Plan'}>} [Plan Weightage])),0,rowno()))/
(Sum ( total {$<DateType={'Plan'}>} [Plan Weightage])))
Measure2(Actual):
if(Universal.MonthYear < date(max(Uni_Act_Date),'YYYY-MM-DD hh:mm:ss.fff'),
IF(if(Sum( {$<DateType={'Actual'} >} [Actual Weightage])=0,null(),
Sum( {$<DateType={'Actual'}>} [Actual Weightage])) = 0, 0,
rangesum(above(if(Sum( {$<DateType={'Actual'}>} [Actual Weightage])=0,null(),
Sum( {$<DateType={'Actual'}>} [Actual Weightage])),0,
rowno()))/(Sum ( total {$<DateType={'Plan'}>} [Plan Weightage]))))
Base:
Month selected:
*Feb values has changed based on the selection, requirement is to have it locked at original values as the next image:
Expected
*Edited in MS Paint
The primary table and data model has many fields thus we are trying to achieve this in front end rather back in load script. Hope this explains the issue in hand 🙂 How do we solve this using front end expressions?
Thanks
Ram
Try these expressions and see if they work
If(If(Sum({$<DateType = {'Plan'}>} [Plan Weightage]) = 0, Null(), Sum({$<DateType = {'Plan'}>} [Plan Weightage])) = 0, 0, RangeSum(Above(If(Sum({$<DateType = {'Plan'}, [Universal.MonthYear]>} [Plan Weightage]) = 0, Null(), Sum({$<DateType = {'Plan'}, [Universal.MonthYear]>} [Plan Weightage])), 0, RowNo()))/(Sum(TOTAL {$<DateType = {'Plan'}>} [Plan Weightage])))
and
If(Universal.MonthYear < Max(Uni_Act_Date), If(If(Sum({$<DateType = {'Actual'}>} [Actual Weightage]) = 0, Null(), Sum({$<DateType = {'Actual'}>} [Actual Weightage])) = 0, 0, RangeSum(Above(If(Sum({$<DateType = {'Actual'}, [Universal.MonthYear]>} [Actual Weightage]) = 0, Null(), Sum({$<DateType = {'Actual'}, [Universal.MonthYear]>} [Actual Weightage])), 0, RowNo()))/(Sum(TOTAL {$<DateType = {'Plan'}>} [Plan Weightage]))))
Try these expressions and see if they work
If(If(Sum({$<DateType = {'Plan'}>} [Plan Weightage]) = 0, Null(), Sum({$<DateType = {'Plan'}>} [Plan Weightage])) = 0, 0, RangeSum(Above(If(Sum({$<DateType = {'Plan'}, [Universal.MonthYear]>} [Plan Weightage]) = 0, Null(), Sum({$<DateType = {'Plan'}, [Universal.MonthYear]>} [Plan Weightage])), 0, RowNo()))/(Sum(TOTAL {$<DateType = {'Plan'}>} [Plan Weightage])))
and
If(Universal.MonthYear < Max(Uni_Act_Date), If(If(Sum({$<DateType = {'Actual'}>} [Actual Weightage]) = 0, Null(), Sum({$<DateType = {'Actual'}>} [Actual Weightage])) = 0, 0, RangeSum(Above(If(Sum({$<DateType = {'Actual'}, [Universal.MonthYear]>} [Actual Weightage]) = 0, Null(), Sum({$<DateType = {'Actual'}, [Universal.MonthYear]>} [Actual Weightage])), 0, RowNo()))/(Sum(TOTAL {$<DateType = {'Plan'}>} [Plan Weightage]))))
Thanks alot Sunny !!
I tried your suggestion earlier and it dint work by itself but your suggestion triggered another idea and I manage to resolve this with the following expression:
if(Universal.MonthYear< date(max(total Uni_Act_Date),'YYYY-MM-DD hh:mm:ss.fff'),
IF(if(Sum( {$<DateType={'Plan'}>} [Plan Weightage])=0,null(),Sum( {$<DateType={'Plan'}>} [Plan Weightage])) = 0, 0,
rangesum(above(if(Sum( {$<DateType={'Plan'},[Universal.MonthYear]>} [Plan Weightage])=0,null(),Sum( {$<DateType={'Plan'},[Universal.MonthYear]>} [Plan Weightage])),0,rowno()))/(Sum ( total {$<DateType={'Plan'},[Universal.MonthYear]>} [Plan Weightage]))
))
Thanks alot for your assistance 🙂
Ram