 # Need help with the function to make a numberic quantity

Hi.
We have function “CASE WHEN KPI(“FFF_TIME_PROCESS”)><%=FFF_TIME_PROCESS_1%> THEN ‘1’ ELSE NULL END”.
How I get a numberic quantity from function?
With function “COUNT” it doesn’t work…

Details:

1. in KPI(“FFF_TIME_PROCESS”) we have AVG(CALC_THROUGHPUT(CASE_START TO CASE_END, REMAP_TIMESTAMPS(“EVENTS_EVENTS”.“EVENT_DATE”, DAYS)))

2. in variable <%=FFF_TIME_PROCESS_1%> we have AVG(CALC_THROUGHPUT(CASE_START TO CASE_END, REMAP_TIMESTAMPS("EVENTS_EVENTS.“EVENT_DATE”, DAYS)))

welcome to our community!

before answering your question let me raise some questions to better understand the purpose of your request:

• Why did you define the FFF_TIME_PROCESS_1% as a variable? Is there any specific reason for that or could you also define it as a saved formula?
• Have you tried to replace the saved formula and the variable with the actual formulas? Does it still throw an error?

Basically, the COUNT() Function returns an Integer. I assume that the issue lies in the formulas/variables that you have defined. Therefore, could you please check whether it works when you replace the variable with the actual formula?

Best,

Justin

Hello, Justin!

There is no important reason, I decided to make it in such a way that the widget had fewer code characters.

I tried to insert the formula into the function - this dont work.

Are there any alternative solutions to the problem?

thanks for checking and coming back to us.
Your formula uses nested aggregations. You can not use AVG() and COUNT() nested in each other. Furthermore, if you look at the formula it is basically calculating the same thing. The average throughput of a case.
So let me raise the question what exactly are you aiming for?

Best,

Justin

Good afternoon!

We have such a concept as a hanging process.

A suspended process is a process that goes through a certain stage over a very long time.

We use this formula to calculate the process time. The average value is 27 days.

If we have a process that exceeds the average value, it slows down.

We need a number of processes that slow down.

in that case, would it be sufficient to define a static_value as a variable? You could set it up as described on the following screenshot:

Afterwards you could use this variable to compare it to the throughput of each case and calculate the case count.

In this case you would use a function similar to the following one:

COUNT(
CASE
WHEN CALC_THROUGHPUT(CASE_START TO CASE_END, REMAP_TIMESTAMPS(“ACTIVITY TABLE”.“TIMESTAMP”, DAYS)) <= <%= avg_variable %>
THEN ‘lower’
ELSE NULL
END
)