Expand my Community achievements bar.

Calculated field question.

Avatar

Level 2

Hello all, 

I'm hoping someone can assist me with a calculated field question. 

My goal is to be able to create a pie chart which shows a breakdown by percent of the segments we support. 

he data is being gathered via  multi-selection drop down lists. 

In order to create the chart I need to add groupings to my report but you can not group data from multi-selected fields. My solution is to create a calculated field populated by the selection in the multi-selected field.  For instance if the field Name is "Cat" and the options in the fields are "black", "white" "tabby", etc.  If any of those options or all of those options are selected, then my calculated field pulls in "Cat".  My grouping in the report could be "Cat".   

 

Can anyone assist with the calculated field formula?  Thank you very much.  

 

1 Reply

Avatar

Community Advisor

Hi Peggy, perhaps code when I did this previously can get you started or at least show you the structure and you can replace with your data. This is definitely helpful if you have a lot of segments (or types or anything with many options) but you want them grouped together into larger buckets in reports and don't want to change the options themselves. In this example, I had a a handful of request types that I wanted to combine into other buckets. You'd replace the 'DE' fields below with your segment custom form field name and of course the items in " ".

CONCAT(IF(CONTAINS("Press Release",{DE:Project/Deliverable Type}),"PR & Influencer, ",IF(CONTAINS("Influencer Partnership",{DE:Project/Deliverable Type}),"PR & Influencer, ")),IF(CONTAINS("Social",{DE:Project/Deliverable Type}),"Organic & Paid Social, "),IF(CONTAINS("Media Engagement",{DE:Project/Deliverable Type}),"Content, ",IF(CONTAINS("Speakership",{DE:Project/Deliverable Type}),"Content, "))))

 

Another example for you here. I wanted to group projects in certain portfolios together to read as different names for reports. This may be more useful for you because it involves OR. The || = OR. So if DE:XX = tabby || DE: YY=white, "Cat" and so forth:
IF({portfolioID}="6065e290000f5601ecde095573c83925"||{portfolioID}="604bf42300bc058482f03079af3c395d"||{portfolioID}="604bec1200b94bea5d6c0aece381472e"||{portfolioID}="6065e2b9000f7578198b91c2d9eeef38"||{portfolioID}="6065e27e000f431fdb73fce26fb9c6bb"||{portfolioID}="61f9a462000dfe6a6892eb652c2ba7fb","Technology Leadership",IF({portfolioID}="6065e3e00010dab933c2ce1d838a7dc7"||{portfolioID}="6065e3d30010cfdc93db8a45988855c9"||{portfolioID}="6065e3f10010e801c2f1bd41215e5e71","For All",IF({portfolioID}="604bf77700bcfaa6226bdd66e2cd4552"||{portfolioID}="6065e2d5000f88924b886de7a087e767","Operational Excellence",IF({portfolioID}="608f4b720006eae5efe5de04b4f35f19","Other",IF({portfolioID}="6065e3c300109cb9fe280c992e737563","Policy")))))

 

Hope this helps!

If this helped you, please mark correct to help others : )