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:
AAA 1
BBB 2
CCC 2
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.
Comments
-
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`
ENDIs 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,
ValiantSpur
**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
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 294 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 607 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 707 Beast Mode
- 49 App Studio
- 39 Variables
- 667 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 44 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 115 Manage
- 112 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive