Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gmoney2594
Partner - Contributor II
Partner - Contributor II

How to get the sum of two variables being subtracted

Hello,

I am currently trying to get the sum of two variables being subtracted from one another. My expression looks like this:

Sum(
aggr(
Count({<[Year]={'2018'},[Project Type]={'IT'}>} [Computer Type]),
-
Count({<[Year]={'2019'},[Project Type]={'IT'}>} [Computer Type])

))

I am getting 0 for the answer but what I want is the difference  between the 2 numbers.

 

Labels (2)
1 Solution

Accepted Solutions
gmoney2594
Partner - Contributor II
Partner - Contributor II
Author

So I want to get the sum of the difference to show.

i.e.   30 - 20 = 10

Then show 10 in the chart

View solution in original post

2 Replies
JGMDataAnalysis
Creator III
Creator III

I don't understand why you are using the Aggr function in your expression...
Maybe something like this?

Count({<[Year] = {2018}, [Project Type] = {IT}>} [Computer Type])
- 
Count({<[Year] = {2019}, [Project Type] = {IT}>} [Computer Type])

 

gmoney2594
Partner - Contributor II
Partner - Contributor II
Author

So I want to get the sum of the difference to show.

i.e.   30 - 20 = 10

Then show 10 in the chart