Return values with condition on another column
Hi, I would like some help with beast mode as I'm very new to this.
I have a list of keywords, URLs and their amount.
There are duplicate keywords with different urls, one containing "/blah/" and one not.
Keyword URL amount
AAA xyz.com/aaa/blah/ 1
BBB xyz.com/bbb/blah/ 2
CCC xyz.com/ccc/blah/ -
AAA xyz.com/aaa/ -
BBB xyz.com/bbb/ -
CCC xyz.com/ccc/ 2
I would like domo to return the amount for URLs containing "/blah/,"
but if the amount is "-", return the amount for URLs not containing "/blah/".
In the above example I would be getting:
Does this make sense?
I know the latter is not correct, if someone can walk me through this I would be very grateful.
(CASE WHEN (`URL` = '%/blah/%') AND (`amount` = '-') THEN `amount` WHEN (`URL` NOT '%/blah/%') ELSE END)
or if there is another way to get around this, I'm all ears.
It might go something like this:
CASE WHEN `URL` like '%blah%' AND `amount` > 0 THEN `amount`
WHEN `URL` NOT LIKE '%blah%' AND `amount` > 0 THEN `amount`
Is the '-' an actual dash or is this a Null? If NULL change the `amount` >0 to `amount` IS NOT NULL
Let me know if you have any questions,
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0
Thank you very much ValiantSpur.
The "-" is an actual dash (word), not null, so the calculation you have written seems to fit.
I'm stuck with another problem though, I can save the beast mode calculation with the "Share Calculation on DataSet" checkbox checked, and I can see it in the "measures" property, but when I put it in a filter and hit "save" the filter disappears.
I read a similar question regarding this problem but I don't quite understand where the "top layer of the card" means. (I am saving the beastmode inside a card analyzer.)
Can anybody help me with this?
"Because drill path cards are not actual cards, BeastModes that are created in the Drill Path will not be saved. In order to ensure the BeastModes are saved, they must be created in the top layer of the card, and have the "Share Calculation on DataSet" checkbox checked. This is the only way to ensure that BeastModes will be saved and checking the box will make them accessible in the drill path cards. Please let me know if you have any questions."0
- 10.5K All Categories
- 7 Connect
- 917 Connectors
- 250 Workbench
- 464 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 477 Datasets
- 190 Visualize
- 252 Beast Mode
- 2.1K Charting
- 11 Variables
- 79 Cards, Dashboards, Stories
- 17 Automate
- 354 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 246 Distribute
- 62 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 173 Product Ideas
- 1.2K Ideas Exchange
- 12 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive