Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
GMellow
Contributor
Contributor

Count text occurrences across multiple columns/fields

Hello,

 

I have the following (simplified notional example) of a table where I want to count the number of "A"s, "B"s...etc across multiple columns without concatenating in the script and show in a bar chart. In this case "A" would be 3, "C" would be 3, "R" would be 2, etc.

 

Type Proj1 Proj2 Proj3 Proj4
A1 A      
A2 C G R y
A3 D C    
A4 A F G J
A5 E R T U
A6 F A G Y
A7 C L P O
A8 Q T Y P
A9 J K X V
A10 S D F G

 

Any help appreciated.

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

maybe like this:

MarcoWedel_0-1656454218619.png

using 3 measures:

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'A'))

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'C'))

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'R'))

View solution in original post

1 Reply
MarcoWedel

maybe like this:

MarcoWedel_0-1656454218619.png

using 3 measures:

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'A'))

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'C'))

Sum(SubStringCount(Proj1&Proj2&Proj3&Proj4,'R'))