Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with two fields: 'Month' and 'Sales.' I want to calculate the Current Year (CY) Growth based on these fields.
Month | Sales |
Apr-23 | 10 |
May-23 | 16 |
Jun-23 | 22 |
Jul-23 | 28 |
Aug-23 | 34 |
Sep-23 | 40 |
Oct-23 | 46 |
Nov-23 | 52 |
Dec-23 | 58 |
Jan-24 | 64 |
Feb-24 | 70 |
Mar-24 | 76 |
Apr-24 | 82 |
May-24 | 88 |
Jun-24 | 94 |
Jul-24 | 100 |
Aug-24 | 106 |
Sep-24 | 112 |
Oct-24 | 118 |
Below is my output:
Month_Date | CY | LY | CY Growth |
700 | 196 | 257% | |
Apr-23 | 0 | 10 | -100% |
May-23 | 0 | 16 | -100% |
Jun-23 | 0 | 22 | -100% |
Jul-23 | 0 | 28 | -100% |
Aug-23 | 0 | 34 | -100% |
Sep-23 | 0 | 40 | -100% |
Oct-23 | 0 | 46 | -100% |
Apr-24 | 82 | 0 | - |
May-24 | 88 | 0 | - |
Jun-24 | 94 | 0 | - |
Jul-24 | 100 | 0 | - |
Aug-24 | 106 | 0 | - |
Sep-24 | 112 | 0 | - |
Oct-24 | 118 | 0 | - |
I want below Output:
MonthName | CY | LY | CY Growth |
700 | 196 | 257% | |
Apr-24 | 82 | 10 | 720% |
May-24 | 88 | 16 | 450% |
Jun-24 | 94 | 22 | 327% |
Jul-24 | 100 | 28 | 257% |
Aug-24 | 106 | 34 | 212% |
Sep-24 | 112 | 40 | 180% |
Oct-24 | 118 | 46 | 157% |
@sachin1 try below. Assuming your Month is already formatted as Numeric.
CY = sum({<Month={"=sum(aggr(above(sum(Sales),12),(Month,(NUMERIC))))>0"}>}Sales)
PY =sum(aggr(above(sum(Sales),12),(Month,(NUMERIC))))
Growth = Column(1)/Column(2)-1
Hello,
You have to create a field "month" without the year and replace the field monthname by your new field.
Regards,
@sachin1 try below. Assuming your Month is already formatted as Numeric.
CY = sum({<Month={"=sum(aggr(above(sum(Sales),12),(Month,(NUMERIC))))>0"}>}Sales)
PY =sum(aggr(above(sum(Sales),12),(Month,(NUMERIC))))
Growth = Column(1)/Column(2)-1