Using LIKE operator in Beast Mode
I am tryign to sum values based on two criteria. This is what I have come up with but it says there is a syntax error. I am not to sure how to use the LIKE and IN operator as I could not find much info on them.
SUM(DISTINCT CASE WHEN `Travel Location` like 'Domestic' and 'International' THEN `Entered Hours` END)
Thanks!
**If this answer solved your problem be sure to like it and accept it as a solution!
Best Answer
-
I'm not sure what your result goal is, but this will fix the syntax error. Gave you one of each method as an example:
SUM(DISTINCT CASE WHEN `Travel Location` like 'Domestic' and `Travel Location` like 'International' THEN `Entered Hours` END)
SUM(DISTINCT CASE WHEN `Travel Location` IN ('Domestic','International') THEN `Entered Hours` END)Best of luck,
Valiant
2
Answers
-
I'm not sure what your result goal is, but this will fix the syntax error. Gave you one of each method as an example:
SUM(DISTINCT CASE WHEN `Travel Location` like 'Domestic' and `Travel Location` like 'International' THEN `Entered Hours` END)
SUM(DISTINCT CASE WHEN `Travel Location` IN ('Domestic','International') THEN `Entered Hours` END)Best of luck,
Valiant
2 -
Hi @Valiant
I tried the second one and I was able to validate it. I have a Stacked Bar chart that has a series seperating the amount of hours worked by domestic travel, international travel, and no travel (all in a column called travel type). The stacked bar sorts by the overal total but I am trying to only sort it by the total amount of travel.
I have struggled with trying to figure this out using beast modes so I made a new dataflow that makes each type its own column and was able to somewhat sort it that way plus or minus a few categories. I am now trying to apply the same concepts to see if I could figure it out using a beast mode.
To sort using the new dataflow I made a beast mode called total travel that just added the values from eac row ( 'Domestic' + 'International') then I sorted using that beast mode in descending order with SUM aggregation.
Now I am trying to do it without using the new dataflow by making the beast mode you suggested but it is not working in the same way.
Thanks!
**If this answer solved your problem be sure to like it and accept it as a solution!
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 656 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 813 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 81 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 142 Manage
- 138 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive