1

I need one help.

I calculate a Difference Between Current Year Sale and Last Year like.

       num(Sum({$<[HSUBSEGM.descr]={"Clinker and Cement"},
    [CALYEAR]={">=$(vCurrentYear)"}>}[_volume_SO]),'##.0')-  num(Sum({$<[HSUBSEGM.descr]
={"Clinker and Cement"},[CALYEAR]={">
=$(vPreviousYear)<=$(vPreviousYear)"}>}[_volume_SO]),
'##.0')

so I m getting and answer Suppose.

This Year sale is 100 $ and Last Year sale was 50 $. so total growth 50 $.

But I want to show growth in %. In this case my Revenue growth is 50 % because it got double from last year..

1 Answers1

0

the mathematical answer should be of this form

(sum(CurrentYearSales)-sum(PreviousYearSales))
/ sum(PreviousYearSales)

So using your example as a guide: I removed some of the num() functions and applied it to only the final result and simplified the set analysis for vCurrentYear and vPreviousYear. That is purely my own style choices.

Give this a go

num(
    (Sum({$<[HSUBSEGM.descr]={"Clinker and Cement"},[CALYEAR]={$(vCurrentYear)}>}[_volume_SO])
    -  Sum({$<[HSUBSEGM.descr]={"Clinker and Cement"},[CALYEAR]={$(vPreviousYear)}>}[_volume_SO]))
    /
    Sum({$<[HSUBSEGM.descr]={"Clinker and Cement"},[CALYEAR]={$(vPreviousYear)}>}[_volume_SO])
,'##0.00%')
The Budac
  • 1,571
  • 1
  • 8
  • 10