Aggregate (SUM) the results of Lead Function Beast mode at Card Level
I have a dataset wherein I have to count the number of cases which falls in the below filter and conditions.
CASE
-- Check if the current row is 'Ringing' and lasted 11 seconds or less
WHEN STATE
= 'Ringing'
AND TIME_TO_SEC(AGENT STATE TIME
) <= 11
AND LEAD(STATE
) OVER (PARTITION BY AGENT NAME
ORDER BY DATE
, AGENT NAME
) = 'Not Ready'
THEN 1
END
This Beast mode is giving me a count of all cases where an agent's phone rings for 11 seconds or less and is followed by a "Not Ready" state.
So, I have marked all of these cases with '1' beside my data as adding a new column. But when I try to sum these by physician, I'm not able to do it. I have even tried using Dataset view and grouping this by summing my beast mode column and Date, Agent name. But ended up getting an error message saying could not process this. All I'm trying to do is sum up these 1's and know for each agent how many of these cases have occured.
Thanks in Advance for the help.
Best Answers
-
Make sure you have back ticks on your fields, and that your field names match the correct spelling.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Answers
-
SUM(CASE
WHEN STATE = 'Ringing'
AND TIME_TO_SEC(AGENT_STATE_TIME) <= 11
AND LEAD(STATE) OVER (PARTITION BY AGENT_NAME ORDER BY DATE, AGENT_NAME) = 'Not Ready'
THEN 1
ELSE 0
END)** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Thanks for the response. But getting 'This calculation contained an error' when using below formula.
SUM(CASE
WHENSTATE
= 'Ringing'
AND TIME_TO_SEC(AGENT STATE TIME
) <= 11
AND LEAD(STATE
) OVER (PARTITION BYAGENT NAME
ORDER BYDATE
,AGENT NAME
) = 'Not Ready'
THEN 1
ELSE 0
END)0 -
Make sure you have back ticks on your fields, and that your field names match the correct spelling.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a 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
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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