Counting codes across multiple fields and relabeling the codes
I'm a new user and trying to do some code counting aggregation.
I have 5 columns of codes (Col1, Col2, Col3, Col4, Col5), and in each there are 20 possible code values for a data record, let's say the possible values fall within 00 to 20. Only 1 possible code per record per column. So data might look like:
Rec Col1 Col2 Col3 Col4 Col5
A 05 10
B 12 00 19
C 01 12 15 00 05
D 05
I come from an excel and SQL background, but not sure how to crack this beast mode (or otherwise).
Aside from counting across all 5 columns so that the output indicates count of each distinct code (eg: three of 05, two of 12, two of 00, etc), the codes need to be relabeled into values. So for simplicity, see attached, and imagine instead of the values 10, 09, 05, etc, it's something like Green, Red, and Blue.
Any direction would be appreciated, thank you.
Best Answer

Welcome!
What I'd do is bring your data into a Magic ETL dataflow and put it through the Collapse Columns transform to restructure it:
Rec Value
A 05
A 10
B 12
B 00
B 19
Then in the card you can just simply count the occurences. You could also join in a mapping chart for what each of these codes means in terms of color.
Code Color
00 Black
05 Red
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"4
Answers

Welcome!
What I'd do is bring your data into a Magic ETL dataflow and put it through the Collapse Columns transform to restructure it:
Rec Value
A 05
A 10
B 12
B 00
B 19
Then in the card you can just simply count the occurences. You could also join in a mapping chart for what each of these codes means in terms of color.
Code Color
00 Black
05 Red
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"4 
You will want to collapse the columns for sure. Does the column number mean anything as well? Would it matter if col 1 was 05 over col 3 being 05?
if so, you would want to collapse your data to have 3 fields;
rec col value
A 1 05
A 2 10
and so on
“There is a superhero in all of us, we just need the courage to put on the cape.” Superman1 
Thanks, this looks like it will do the trick!
1
Categories
 All Categories
 1.7K Product Ideas
 1.7K Ideas Exchange
 1.5K Connect
 1.2K Connectors
 295 Workbench
 6 Cloud Amplifier
 8 Federated
 2.8K Transform
 98 SQL DataFlows
 608 Datasets
 2.1K Magic ETL
 3.8K Visualize
 2.5K Charting
 712 Beast Mode
 50 App Studio
 39 Variables
 668 Automate
 170 Apps
 446 APIs & Domo Developer
 45 Workflows
 7 DomoAI
 34 Predict
 14 Jupyter Workspaces
 20 R & Python Tiles
 391 Distribute
 111 Domo Everywhere
 274 Scheduled Reports
 6 Software Integrations
 116 Manage
 113 Governance & Security
 Domo Community Gallery
 31 Product Releases
 9 Domo University
 5.3K Community Forums
 40 Getting Started
 30 Community Member Introductions
 104 Community Announcements
 4.8K Archive