Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
sachin1
Contributor III
Contributor III

Current Year (CY) Growth

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%
Labels (4)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

@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

 

Screenshot 2024-11-06 at 16.44.19.png

 

View solution in original post

2 Replies
VBD
Partner - Creator II
Partner - Creator II

Hello,

You have to create a field "month" without the year and replace the field monthname by your new field.

Regards,

Valentin Billaud
Next Decision
Kushal_Chawda
MVP
MVP

@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

 

Screenshot 2024-11-06 at 16.44.19.png