2 Replies Latest reply on Oct 25, 2016 9:50 AM by Alan Asher

# Adding values & sum to multi-select picklists (Salesforce)

Hi all,

I'm using Salesforce with Tableau and am working on replicating a number of roll-up and formula fields in Tableau Desktop. I have a multi-select picklist where I want to:

1. add a value for each selection

2. sum all values selected

The example attached shows Tuesday, Wednesday, Thursday and Friday selected which each have a value of 1 and therefore this would total 4. Each day would have a value of 1 with the exceptions of M-F which would be 5, M-S which is 7 and S-S which is 2. We use the total number of days to calculate the weekly number of hours per record in Salesforce; which is used for other processes.

The calculation isn't complete it's not summing multiple selections; is there a simple fix to this issue?

IF [Days] = "Monday"  then '1'

ELSEIF [Days] = "Tuesday"  then '1'

ELSEIF [Days] = "Wednesday"  then '1'

ELSEIF [Days] = "Thursday"  then '1'

ELSEIF [Days] = "Friday"  then '1'

ELSEIF [Days] = "Saturday"  then '1'

ELSEIF [Days] = "Sunday"  then '1'

ELSEIF [Days] = "M-F"  then '5'

ELSEIF [Days] = "M-S"  then '7'

ELSEIF [Days] = "S-S"  then '2'

END

Many thanks

• ###### 1. Re: Adding values & sum to multi-select picklists (Salesforce)

Hi Adam Serota,

I don't see any issue in there... does anyone in the community can spot the problem in this calculation please?

In the meantime Adam, could you please provide us with a workbook (.twbx)?

• ###### 2. Re: Adding values & sum to multi-select picklists (Salesforce)

Adam, this is how I would do it (assuming [Days] is a standard pick list in Salesforce: Then remember to choose 'Measure (Sum)' once you drop this custom calc into your viz

IF CONTAINS([Days], 'Monday')  then 1

ELSEIF CONTAINS([Days] = 'Tuesday')  then 1

ELSEIF CONTAINS([Days] = 'Wednesday')  then 1

ELSEIF CONTAINS([Days] = 'Thursday')  then 1

ELSEIF CONTAINS([Days] = 'Friday')  then 1

ELSEIF CONTAINS([Days] = 'Saturday')  then 1

ELSEIF CONTAINS([Days] = 'Sunday')  then 1

ELSEIF CONTAINS([Days] = 'M-F')  then 5

ELSEIF CONTAINS([Days] = 'M-S')  then 7

ELSEIF CONTAINS([Days] = 'S-S')  then 2

END