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.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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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