Beast Mode division calculation not work
Hello everyone,
I've read other related posts and tried with my case but still failed, see if anyone could help. Thanks in advance!
I try to get the % of certain rating (with 'green' or 'acceptable'), but I always get the result=2 with my formula. However, it returns the correct count when I do the numerator and denominator separately, but just failed to get the divided number. note: I need DISTINCT as the `Factory ID` in my case have mutliple records in data.
my formula is like this:
COUNT(DISTINCT (CASE when lower(`Latest FA Rating`) like '%acceptable%' or lower(`Latest FA Rating`) like '%green%' then `Factory ID` end)) / COUNT(DISTINCT `Factory ID`)
fyi., I have also tried these as suggested in some posts but also failed to get the correct result:
i tried this:
case when COUNT(DISTINCT `Factory ID`)=0 then 0 else
(COUNT(DISTINCT (CASE when lower(`Latest FA Rating`) like '%acceptable%' or lower(`Latest FA Rating`) like '%green%' then `Factory ID` end)) / COUNT(DISTINCT `Factory ID`)) end
and also either of these - both return a super large value:
case when COUNT(DISTINCT `Factory ID`)=0 then 0 else
(COUNT(DISTINCT (CASE when lower(`Latest FA Rating`) like '%acceptable%' or lower(`Latest FA Rating`) like '%green%' then `Factory ID` end)) / COUNT(DISTINCT `Factory ID`) over ()) end
OR
(COUNT(DISTINCT (CASE when lower(`Latest FA Rating`) like '%acceptable%' or lower(`Latest FA Rating`) like '%green%' then `Factory ID` end)) / COUNT(DISTINCT `Factory ID`) over ())
Much appreciate if anyone can help and share your thought! THANKS in advance!
regards,
Nek
Comments
-
Hello Nek,
If you have live support included in your package I would reach out to support directly. If a member of the support team can visually see your data and how it's working they may be able to offer you the answers you are looking for.
Jarvis
0 -
can you show what kind of card you are using the calculation on? I tried to create a sample data set and found your calculation performing correctly.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
thanks Jarvis! can you advise how to check if i have live support in my package? I am using company's account for DOMO. thank you!
0 -
thanksST_-Superman-_!
my data is like factory-case-level, each factory might have multiple cases while there is the same status for each factory.
what I want to do is to compute the % of total factories with the status named like '%green%' or '%acceptable%'so at first I tried a formula this way:
numerator: to get the distinct count of factory with the required status
denominator: to get the total distinct count of factoryCOUNT(DISTINCT (CASE when lower(`Latest FA Rating`) like '%acceptable%' or lower(`Latest FA Rating`) like '%green%' then `Factory ID` end)) / COUNT(DISTINCT `Factory ID`)
however, it always returns 2 from this formula
please let me know if any more details I should provide.
thanks a lot for your help in advance!!
best regards,
Nek0
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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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