Page 1 of 1

How to create this metric

Posted: Wed Apr 02, 2025 1:57 pm
by Mosufe
Hello, i'm trying to create a metric that calculate the percentage of itens on time. In other tools i used to use this code:

Code: Select all

1-
count(distinct
case when status_sla = 'SLA rompido' then numero_ticket end
)
/
count(DISTINCT numero_ticket)
But i can't work around how to create that with Stimulsoft, can sameone help? I've already tested some things, but none worked and i think that is'nt helpfull here.

Re: How to create this metric

Posted: Wed Apr 02, 2025 10:03 pm
by Lech Kulikowski
Hello,

Please check the Totals functions in the Dictionary.

Thank you.

Re: How to create this metric

Posted: Thu Apr 03, 2025 12:51 pm
by Mosufe
I looked in the data dictionary and the function was supposed to be CountDistinct(field), but after some testing and with the help of the tool, I found that the correct function is DistinctCount(field). However, I wasn't able to get the rest of the function to work... Below is the code:

Code: Select all

1-
DistinctCount(IF(vw_mtz_tk_solicitacao_servico_v3.status_sla = 'SLA Rompido', vw_mtz_tk_solicitacao_servico_v3.numero_ticket, NULL)
/DistinctCount(vw_mtz_tk_solicitacao_servico_v3.numero_ticket)
Anyway, thx for the help.

Re: How to create this metric

Posted: Fri Apr 04, 2025 9:18 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.