Nested Case When?
Hello. I have this slicer and its beast mode below:
Here's what I want to achieve:
If Project Maya is selected, the column 'Action' should show only 'Disregard' results.
If any of the other 3 was selected, the column 'Action' show only 'Resolved' results.
Not sure if nested case when statement will work on this. Please help.
Best Answers
-
@Zel Start with this KB Article to point you in the right direction!
0 -
@Zel
Can you do something like-
SUM(CASE
WHEN
Project = 'Maya'
THEN
(CASE WHEN Action= 'disregard' THEN 1 ELSE 0 END)
WHEN
Project IN ('US','International','Mendel') THEN
(CASE WHEN Action ='email resolved' THEN 1 ELSE 0 END)
ELSE
0
END)
This should work. Here Project could be variable control or column based on your requirement. Looks like it should be a variable control. and please change the column names according to your dataset.
Let us know if this does not work'Happy to Help'0
Answers
-
Hi @MichelleH , apologies, I haven't tried setting up a variable control. Can you please give me an idea how to do it? It will be much appreciated.
0 -
@Zel Start with this KB Article to point you in the right direction!
0 -
thank you @MichelleH 😊
0 -
@MichelleH reviewing the link that you sent now. Also, just want to clarify, based on the output that I want to achieve (see previous post in this thread), does variable control also work with showing output from columns?
Because the 'Action' column from the dataset contains like 20 or more different actions. So based from the slicer above:
If Project Maya is selected, the column 'Action' should show only 'Disregard' results.
If any of the other 3 was selected, the column 'Action' show only 'Resolved' results.
0 -
@MichelleH please see below:
If I selected Project Maya, the 2nd column should only count 'disregard' actions.
If I selected US, International or Mendel, the 2nd column should only count 'email resolved' actions.
Currently, the below image only counts 'email resolved' actions.
0 -
@Zel
Can you do something like-
SUM(CASE
WHEN
Project = 'Maya'
THEN
(CASE WHEN Action= 'disregard' THEN 1 ELSE 0 END)
WHEN
Project IN ('US','International','Mendel') THEN
(CASE WHEN Action ='email resolved' THEN 1 ELSE 0 END)
ELSE
0
END)
This should work. Here Project could be variable control or column based on your requirement. Looks like it should be a variable control. and please change the column names according to your dataset.
Let us know if this does not work'Happy to Help'0 -
Hi @Aditya_Jain how can I get the value from which was selected in the slicer and assign it as a variable control - Project?
The thing is, for the initial slicer, I had to do the mapping of the customers/chain and assign them as Project Maya, US, International and Mendel.
Then for the variable control, this will be used in several cards on the dashboard. Will I be able to get the value from the initial slicer (whichever was clicked there and perform what the variable control should do?)
0 -
@Zel - We can not take a value from Slicer and assign it to Variable control, but a value selected from a variable control can be used within a beast mode.
Please see if this helps'Happy to Help'0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive