Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want the color of Profit\Loss to be changed to Red(Negative Values) and Green(Positive Values) for DTD, MTD and YTD.
It should be changed only in Profit\Loss.
PFA Qvw.
Please help me with this ASAP.
Thanks & Regards,
Keerthi
HI All,
I got the solution.
I have used the below expression in Background Text
if(CATEGORY='Profit\Loss',
if([Time Dimension]='DTD',
if(sum({$<TradeDate={'3/28/2014'}>}SalePrice)-sum({$<TradeDate={'3/28/2014'}>}TradePrice)>0,Green(),red()),
if([Time Dimension]='MTD',
if(SUM({<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},TradeDate=>}SalePrice)-SUM({<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},TradeDate=>}TradePrice)
>0,Green(),red()),
if([Time Dimension]='YTD',
if(SUM({<Year={'$(vMaxYear)'},TradeDate={'<=$(vMaxDate)'},Month=,Day=>}SalePrice)-SUM({<Year={'$(vMaxYear)'},TradeDate={'<=$(vMaxDate)'},Month=,Day=>}TradePrice)>0,Green(),red()),
)
)
)
)
Thanks & Regards,
Keerthi
I suggest use variables for this like
vDTD = if(sum({$<TradeDate={'3/28/2014'}>}SalePrice)-sum({$<TradeDate={'3/28/2014'}>}TradePrice)
vMTD = if(SUM({<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},TradeDate=>}SalePrice)-SUM({<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},TradeDate=>}TradePrice)
vYTD = if(SUM({<Year={'$(vMaxYear)'},TradeDate={'<=$(vMaxDate)'},Month=,Day=>}SalePrice)-SUM({<Year={'$(vMaxYear)'},TradeDate={'<=$(vMaxDate)'},Month=,Day=>}TradePrice)
And then use your expression like
if(CATEGORY='Profit\Loss',
if([Time Dimension]='DTD',
$(vDTD)>0,Green(),red()),
if([Time Dimension]='MTD',
$(vMTD)>0,Green(),red()),
if([Time Dimension]='YTD',
$(vYTD)>0,Green(),red()),
))))
Hope this helps