Issue with Beast Mode Calculation not displaying on the card.
I am trying to find the conversion % for two different marketing sources. What % of those that inquire in either the walk in channel or the phone channel actually rented.
I wrote this beast mode calculation, but nothing is displaying:
SUM(CASE WHEN 'lead_source' = 'Walk_In' AND 'unit_rented_c' = 1 THEN 1 END)/SUM(CASE WHEN 'lead_source' = 'Walk_In' THEN 1 END)
Looking at the calculation beast mode isn't giving me a syntax error and the logic seems to make complete sense. What am I not accounting for?
Comments
-
Hi @user048760
This is because you don't have an else clause so any record which doesn't have a Walk_In lead_source would return NULL which make your entire aggregate as NULL. Try adding an ELSE 0 clause to both of your numerator and denominator case statements.
SUM(CASE WHEN 'lead_source' = 'Walk_In' AND 'unit_rented_c' = 1 THEN 1 ELSE 0 END)/SUM(CASE WHEN 'lead_source' = 'Walk_In' THEN 1 ELSE 0 END)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2 -
@user048760 , FYI Beast modes are case sensitive, so check that you have case correct.
SUM(CASE WHEN `lead_source` = 'Walk_In' AND `unit_rented_c` = 1 THEN 1 END) / SUM(CASE WHEN `lead_source` = 'Walk_In' THEN 1 END)
also tilda, `, is used to differentiate columns whereas single ticks, ' , are used to differentiate strings. Did you type it in correctly?
@GrantSmith , in this context I don't think the else 0 matters.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
@GrantSmith I attempted include the ELSE 0 END, and it did return values that were able to be displayed on the card, but it just returned 0% for everything.
@jaeW_at_Onyx I went through and I am fairly certain I have typed it correctly.
I have written beast mode calculation previously for the overall conversion rate for the company. That can be seen below. unit_rented_c is obviously the column for those inquiries that did rent, and 'id' is a column with unique id's attached to all inquiries. Now I am trying to calculate a column for individual channels from the lead_source column and things just aren't going as smoothly.
sum(case when `unit_rented_c` = 'true' then 1 end)/count(`id`)
1 -
@jaeW_at_Onyx I tried both the single ticks and tilda around the columns, and the result was the same.
1 -
@user048760 could you update your profile handle so it's easier to AT mention you?
can you give us a sample of your data. it sounds like it should be pretty straight forward.
split numerator and denominator into separate beast modes and pop it into a table card. if your denominator is zero then you know hwat the problem is (can't divide by zero) if the numerator is zero... it explains the zero. but hone in on the problem.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"2 -
@jaeW_at_Onyx SMH, I figured it out, it was a dumb oversite on my end. I appreciate your help. You helped point me in the right direction to discover this tedious mistake.
3 -
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"2 -
This is the first time I have posted a question and accepted an answer. Can you direct me on how exactly to close this out? I just keep clicking around and I am getting nowhere.
0 -
You likely can't accept an answer because it was created as a topic instead of a question. I did the same thing earlier because the orange button was initially default to create a topic.
@Anna Yardley Can you assist and get this post changed to a question so the person can mark one of these comments as an answer?
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
@MarkSnodgrass Lesson Learned! Thank you.
1
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