Logic to add same topics from different fields in a single field

In the snapshot, you can see there is a column topics_all that contains all the topics for a message in that row. in its right, there are in total 4 columns named topic_col1, topic_col2 and so on that contain each separated topic topics_all column in that same row. now i want to create a field or logic that gets the exact of each topic so that i can create a visual for it. Using ifelse is giving me a wrong count because it certainly skips the rest of the columns to check after matching the condition in the first column. Is there a way to achieve this?

@bhardwaj Hi

Can you elaborate more on “exact of each topic”?
e.g. what will be the expected out for exact of topic_col1?

1 Like

@neelay Hello. That must have been a typo. What I meant is this:
the topic_col1 holds the first element of each row in topics_all column. topic_col2 holds the second element and so on.
for e.g. if topics_all has ‘Connectivity-Performance’ then topic_col1 holds Connectivity and topic_col2 holds Performance. Basically topic_col1, topic_col2 and topic_col3 hold the separated values from topic_all (separated by hyphen symbol).
What I want is a logic or a method that can give the exact count of each topic (counting from all three columns topic_col1, topic_col2 and topic_col3). So that I can make a bar or pie visual out of them.
for example, by following the image above, Connectivity has 3 occurrences, Performance has 1 and Feedback and Suggestion has 3 occurrences. Pump has 1 and so on.

@bhardwaj NP
you can just put this data into table visual and have col1,2,3 in the aggregate section where the aggregation formula is sum.

Play with the Table visual, and diff options

1 Like

@neelay I do not understand. Can you elaborate the steps a bit more? I can’t find any aggregate section in my visuals. I already spent a lot of time on this issue.

@bhardwaj I can’t help you with the time :smiley:.

1 Like

@bhardwaj - Did @neelay example help solve your issue? If so, would you please mark as Solution. If not, please provide additional details on where you need help.