Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey.
I would like to script the following:
if(sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) >=3000 ,Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount), '0'
or
if(Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) <=-3000 ,Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount),'0'))
What I'm trying to achieve is to have my pivot table display the sum(amount) where, sum(amount) is >=3000 or <= -3000.
at present the above expression only returns the >=3000 part the of expression.
could someone please point me in the right direction
Thanks
Bon
if(sum(Amount)>=3000 or sum(Amount)<=-3000, sum(Amount),0)
replace sum(Amount) with your expression
use and instead of or
if(sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) >=3000 and
Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) <=-3000 ,
Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount),0)
Check the number of opening and closing brackets...
if(sum(Amount)>=3000 or sum(Amount)<=-3000, sum(Amount),0)
replace sum(Amount) with your expression
Thanks Massimo and Manish.
correct expression was OR, using AND returned 0.
if(sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) >=3000 or
Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount) <=-3000 ,
Sum({<Year=,Month=, Date={'>=$(vYTDStart)<=$(vYTDEnd)'}>}Amount),'0')