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.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive