Forum Discussion
Creating IF Statement Over Category
- 7 years ago
you should be abel to use a switch statement
SWITCH (
TRUE (),
[Sum] < 5000000, "<$5M",
[Sum] > 5000000
&& [Sum] <= 10000000, "$5M - $10,",
[Sum] > 10000000
&& [Sum] <= 15000000, "$10M - $15M",
[Sum] > 15000000
&& [Sum] <= 20000000, "$15M - $20M",
[Sum] > 20000000, ">$20M",
BLANK ()
)
vanessafvg - What happens is that I need the IF or Switch statement to also factor in a category column.
Here is a screenshot of what I am trying to achieve, on the left is the [Classification] column which is a calc. column which is based on the conditions laid out (eg:- [Sum] < 5000000 , "<$5M" etc. ) and the [Sum] Column which gives a total for the <$5M slot (360..) as different from the right table which is only for <$5M.
The right table has the intended result as it has the [Sum] column and also the [Category] column (addition of this column is key which gives the intended result) and I have added a filter on the [Sum] column (via the filter pane) for less than $5M and that gives a total of $44,807 which is the desired output. As in the end, I want to divide that by the total of the [Sum] column and do the % Grand Total in a pie chart. In short, the calc column should have the condition based on the [Sum] column but consider/factor the [Category] column too.