Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to use the following set analysis expression:
Sum(If({$<Division={'B'},FY={$(vFY)}>}+,
What I am trying to do is get the Sum of + when Division = 'B' and FY = vFY and if it does not, then get the Sum of
May be like this:
Sum(If(Division='B' and FY=$(vFY), + ,
Or this:
RangeSum(Sum({$<Division*= {'B'}, FY *= {$(vFY)}>} +), Sum({$<Division -= {'B'}, FY -= {$(vFY)}>}
Can I not use Set Analysis for this type of expression?
You might, but not every thing can be solved using if statement.
The second sum looks incorrect to me. Say vFY = 2016, and we have this data:
FY Division
2015 A
2016 A
2015 B
2016 B
The first sum will correctly get row 4. The second sum is intended to get rows 1, 2, and 3, but I think it will only get row 1. And I don't think we need rangesum() because sum() should never return null, I believe.
I think this would do the trick.
sum({<Division={'B'},FY={'$(vFY)'}>} A+B)+sum({$-<Division={'B'},FY={'$(vFY)'}>} C+D)
Yes sir, I forgot my Venn Diagram lessons here . This should work I believe
RangeSum(Sum({$<Division*= {'B'}, FY *= {$(vFY)}>} +), Sum({$<Division -= {'B'}>+<FY -= {$(vFY)}>}
Updated from * to + based on John's response
Almost, but same problem:
<Division-={'B'}> = {1,2}
<FY-={$(vFY)}> = {1,3}
{1,2}*{1,3} = {1}
{1,2}+{1,3} = {1,2,3}
So we need to use union + instead of intersection *, but otherwise, yes, you can fix your expression as you showed. I think mine's a little more clear, as it has the if/else form of "some set" and "everything except that set", but both look like they'd work.
Hahahaha yes.... how can I be so stupid... Well at time I can be. My intentions were right, my expressions were not