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.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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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