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
- 11K All Categories
- 5 Private Company Board
- 2 APAC User Group
- 12 Welcome
- 42 Domo News
- 9.9K Using Domo
- 2K Dataflows
- 2.5K Card Building
- 2.2K Ideas Exchange
- 1.2K Connectors
- 349 Workbench
- 267 Domo Best Practices
- 12 Domo Certification
- 474 Domo Developer
- 51 Domo Everywhere
- 110 Apps
- 726 New to Domo
- 85 Dojo
- Domopalooza
- 1.1K 日本支部
- 4 道場-日本支部へようこそ
- 29 お知らせ
- 65 Kowaza
- 302 仲間に相談
- 664 ひらめき共有