Saved Search Question - Is it possible to mix info...
# general
m
Saved Search Question - Is it possible to mix information from multiple accounts? We have a COGS account on our Income Statement. I would like to divide the sum from the COGS account by total orders that are related to a different account (example below) I am having an issue trying to create the Avg column. I think there is an error with the fact that both accounts aren't on the same line (example below). I collect orders by COUNT(DISTINCT({refnum})). {refnum] is only populated for Account 1. Account 2 is blank. First attempt to get the average was SUM(CASE WHEN {account} = 'Account 1' THEN {amount} ELSE NULL END) / COUNT(DISTINCT({refnum})) however that was giving an error stating the formula could not divide by 0. Apologize if this is the wrong channel. Any help/suggestions/resources appreciated!
c
@Marko Onyskiv Commenting on the divide by zero error part- Wrap your denominator in NULLIF({denominator},0). That will avoid the divide by 0 error.
m
Thank you Chloe - Late response but this was a helpful hint! I am still sorting through the logic of the report but am no longer getting an error in the formula column
šŸ‘ 1