Using average formula for a calculated column having sum and count
Hi,
I am trying to get an average of a calculation having a sum and a count used in it. something looks wrong considering it is looking at the avg and then sum, can someone help me with this? or suggest an alternative if possible?
AVG
((CASE when SUM(`ext_sls_a`)/
COUNT((CASE when `listing_status`='APPROVED' AND `inventory`=0 then 'Live OOS items'
when `listing_status`='APPROVED' AND `inventory`>0 then 'Live Purchasable items'
else 'Pending, Rejected, Suspended' end)) then 'Live' else 'Not Live'
end ))
Comments
-
It looks as though your issue lies in the first case statement not having a condition. What do you want your SUM / COUNT to equal to in order to use `Live` ? That part appears to be missing.
Just before "then `Live`" you should have a greater than, or less than or equal to and a number. Hope that makes sense.
**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.0 -
... i don't think you understood my last response to your last question.
https://dojo.domo.com/t5/Beast-Mode-ETL-Dataflow/Case-within-case-in-beast-mode/m-p/50010
you have the same problem.
you're applying AVERAGE to an aggregated row. SUM and a COUNT both of which will contain one row each.
so your result will be the same as the value with AVG() removed.
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"0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 98 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 713 Beast Mode
- 50 App Studio
- 39 Variables
- 669 Automate
- 170 Apps
- 447 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 104 Community Announcements
- 4.8K Archive