Skip to main content
Solved

How to count multi-select attribute values individually?

  • January 11, 2022
  • 2 replies
  • 181 views

Forum|alt.badge.img

Does anyone know how to accomplish this?

A pivot table counts the values as stored in the database (multiple values concatenated, separated by commas), I want to count them individually.

In this example, the counts should be as follows:

Value 1 = 3

Value 2 = 2

Value 3 = 3

 

Best answer by lauraj46

Hi @JohnBeiler61 ,

I think you could make this work by doing a cross join between CSAnswers and CSAttributeDetail.  

 

Replace ‘TEST’ with the id of your attribute. 

Because of the cross join, each of the possible choices (from CSAttributeDetail) will be compared with each of the answers (from CSAnswers).  The InStr function returns the position where the text is found, or 0 if not found.

 

 The hidden parameter makes it easier to build the formula into the Condition tab.

 

This will filter to return just the records that match.

This is what the results of the Generic Inquiry look like:

Then you can build the pivot something like this:

 

End result:

 

Hope this helps!

Laura

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img
  • Author
  • Freshman II
  • 32 replies
  • January 28, 2022

I discovered I incorrectly stated the expected count for Value 3, it should be 2 not 3.


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 564 replies
  • Answer
  • February 8, 2022

Hi @JohnBeiler61 ,

I think you could make this work by doing a cross join between CSAnswers and CSAttributeDetail.  

 

Replace ‘TEST’ with the id of your attribute. 

Because of the cross join, each of the possible choices (from CSAttributeDetail) will be compared with each of the answers (from CSAnswers).  The InStr function returns the position where the text is found, or 0 if not found.

 

 The hidden parameter makes it easier to build the formula into the Condition tab.

 

This will filter to return just the records that match.

This is what the results of the Generic Inquiry look like:

Then you can build the pivot something like this:

 

End result:

 

Hope this helps!

Laura


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings