## How to sum checbox checked?

Highlighted
Occasional Contributor

## How to sum checbox checked?

Hi All,

I have maybe a simple doubt, how do it sum the checked options ?

I need to have one line item showing : 3

Regards,

Julio Baudino

7 REPLIES 7
Highlighted
Master Anaplanner/Community Boss

## Re: How to sum checbox checked?

Couldn't resist jumping in on this one. I do this all the time with my system modules.

Best way I've found is to create one more line item formatted as a number, similar to your comment line item, and 1 if TRUE else 0. Set your conditional to be the most likely so if there are more unchecked then checked then write the formula as If false then 0 else 1. You always want Anaplan to exit the conditional as fast as possible and it looks like you're using a lot of dimensions so this will be important.

The last part is to write the SUM which will just be reference (without the SUM function) if you're using a structured list. If not you'll need to use the SUM and/or TIMESUM function.

This module has no time dimension

Jared Dolich
Highlighted
Master Anaplanner/Community Boss

## Re: How to sum checbox checked?

Very well done and absolutely correct.  One suggestion on the module without the time list, try to avoid using TimeSum as it is a single threaded calculation.  As an alternative, in the Time settings, click on Total of All Periods and do a Select at this level (Checkbox Sum.Count[SELECT: TIME.All Periods]) , again if the target is not using Time.

If your source module is not using Time but all lists have a Top Level, then the Select will not be needed.

Hope this helps,

Rob

Highlighted
Super Contributor

## Re: How to sum checbox checked?

Create another no formatted line item and put it 1 based on true boolean, then aggregate over that numeric line item using timesum

Highlighted
Master Anaplanner/Community Boss

## Re: How to sum checbox checked?

Please see above, TimeSum is not the best way to do this.

Highlighted
Super Contributor

## Re: How to sum checbox checked?

Thanks Rob, appreciate, however how to do if all periods is not enabled?
Highlighted
Master Anaplanner/Community Boss

## Re: How to sum checbox checked?

Selecting All Periods and enabling that is much more performant than using TimeSum.

Rob

Highlighted
Occasional Contributor

## Re: How to sum checbox checked?

Thank you all for the solution proposed and discussion.