Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
arvindjha2050
Creator
Creator

Positive/negative trend using Expressions

Hello Team,

I have a table with 3 columns :

Year,Product,Sales

The data is for Sales of various products for the last 3 years.

How can we get list of only those products whose sales have shown a positive trend YOY , say the total sales of those products not only increased from 2015 to 2016 but also from 2016 to 2017.

How to achieve it?

Thanks,

Arvind

Labels (2)
5 Replies
sunny_talwar

Hi Arvind - 

Would you be able to share few rows of sample data and the output you expect to see from the sample data you share to better understand what you are trying to get?

arvindjha2050
Creator
Creator
Author

Hello Sunny ,

Thanks for the response.

Sample Data :

Load * Inline
[
SYear,Product,Sales
2015,A,10
2016,A,11
2017,A,10.5
2015,B,10
2016,B,11
2017,B,12
2015,C,10
2016,C,9
2017,C,8
];

 

We want to create two dimensions , one dimension with list of products with increasing sales from 2015 to 2016 and into 2017 i.e. Product B

 

another dimension with list of products with decreasing sales from 2015 to 2016 and into 2017 i.e. Product C

 

Thanks,

Arvind

uacg0009
Partner - Specialist
Partner - Specialist

Hi,
where do you want to make it? in front-end or back-end?
If in front-end I think it's not too hard.
eg. straight table. dimension : Product and choose suppress null value
increase expression: if(sum({<SYear = {"2016"}>}Sales) > Sum({<SYear = {"2015"}>}Sales) AND Sum({<SYear = {"2017"}>}Sales) > Sum({<SYear = {"2016"}>}Sales),Sum(Sales),null())
decrease expression is same like above one.
Aiolos Zhao
arvindjha2050
Creator
Creator
Author

This i have already tried , it shows as Invalid Dimension

uacg0009
Partner - Specialist
Partner - Specialist

See my attachment.

Positive negative trend using Expressions.PNG