Convert values using mapping with case
I have 2 columns, primaryAssemblies and secondaryAssemblies.
A person could have "Clinical Care" as their primary assembly.
They are allowed at least 1 secondary assembly. So it may look like "Critical Care, Pediatrics"
I need to count each occurrence like so:
(CASE
when `PrimaryAssembly` like '%Allergy Immunology & Inflammation%' or `SecondaryAssemblies` like '%Allergy Immunology & Inflammation%' then 1
when `PrimaryAssembly` like '%Behavioral Science and Health Services Research%' or `SecondaryAssemblies` like '%Behavioral Science and Health Services Research%' then 2
when `PrimaryAssembly` like '%Clinical Problems%' or `SecondaryAssemblies` like '%Clinical Problems%' then 3
end
)
The values showing in the beast mode field are not correct.
I'm trying to count each occurence, whether in the first column (primaryAssemblies) or second column (secondaryAssemblies).
Any ideas?
Comments
-
The output of your case statement there is going to be the number 1, 2, or 3. Is that what you want? To display one of those numbers?
You asked to count each occurrence, but I'm not seeing a count function here. Is that aggregation in the card configuration?
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"0 -
Yes, I'd like to get the integers to show.
The counting will be a card feature.
I hope to then use a Legend:
1 = "Critical Care"
2 = "Another item"
3. .....etc
0 -
What are you seeing as the output and what are you expecting to see?
Do you want to count Critical Care or the other values twice if it shows up in both the primaryAssembly and the secondaryAssembly?
Does your secondaryAssembly always include the text of your primaryAssembly? If so you could simplify your beast mode by just including the secondaryAssembly comparison
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"0 -
"Critical Care" will not show in both columns. It will appear in only one of the columns.
I want to count each occurence on each row.
0 -
I'd simplify your beast mode by bringing your assembly values together into one comparison.
CASE
WHEN CONCAT(`PrimaryAssembly`,`SecondaryAssemblies`) like '%Allergy Immunology & Inflammation%' THEN 1
WHEN CONCAT(`PrimaryAssembly`,`SecondaryAssemblies`) like '%Behavioral Science and Health Services Research%' THEN 2...
ENDThen on the card count your transaction ID or whatever your row identifier is, with this beast mode as the dimension or series. Does something like that work for you?
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"0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive