# Result in Percentage of service in a single query

**URL:** <https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657>\
**Category:** DQL\
**Tags:** dql, notebooks, logs\
**Created:** [January 16, 2026, 11:51am UTC](https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657 "2026-01-16T11:51:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumarv14](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kumarv14](https://community.dynatrace.com/u/kumarv14)\
**Post date:** [January 16, 2026, 11:51am UTC](https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657/1 "2026-01-16T11:51:20Z")

</div>

i wants to check % of success and failure in my query these are (0",“1”,“200”,“1001”,“2001”,“5001”,“5450”)success code rest are all error code , so how can i get % of service in succes and failure respectively .  
with this query i am achhieving counts of error code ,so it possible to get success and failure counts with % of success and failed one . Please help me to resolve this issue .

fetch logs,scanLimitGBytes:-1  
| filter dt.system.bucket==“engineering” and index == “db”  
| filter Market == “IND”  
| filter not in (ResultCode,array (“0”,“1”,“200”,“1001”,“2001”,“5001”,“5450”))

| summarize count(),by:{TransactionType,ResultCode,ApiName}  
|dedup TransactionType

[@krzysztof\_hoja](https://community.dynatrace.com/user/25373)

---

<div class="post-metadata">

**Author:** ![kumarv14](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kumarv14](https://community.dynatrace.com/u/kumarv14)\
**Post date:** [January 16, 2026, 12:30pm UTC](https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657/2 "2026-01-16T12:30:37Z")

</div>

@krzysztof_hoja could you please check my table data which one are for success and failure respectively i wants in a single table % of success and failure with counts of total and failed .

 ![table of success.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1673a06ce382bd3f28c29e2f48a5e0884d5071e6.png)  
 ![table of error.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/d/6dfd8682cd9d77c0a54910e38ecbb6d33491d36e.png)

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [January 26, 2026, 6:04pm UTC](https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657/3 "2026-01-26T18:04:49Z")

</div>

I hope this example explains how to do this:

```markup
data 
record(ResultCode="0", TransactionType="A"),
record(ResultCode="0", TransactionType="A"),
record(ResultCode="0", TransactionType="A"),
record(ResultCode="1", TransactionType="A"),

record(ResultCode="0", TransactionType="B"),
record(ResultCode="1", TransactionType="B"),
record(ResultCode="0", TransactionType="B"),
record(ResultCode="1", TransactionType="B")

| summarize { ci=countIf(in(ResultCode,{"1"})),
c = count() }, by: {TransactionType}
| fieldsAdd p = 100.0*ci/c

```

Result looks like this:

 ![krzysztof_hoja_0-1769450664891.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/e/ce3f30e366048c025f8dba58133cff11b1ec951d.png)

---

<div class="post-metadata">

**Author:** ![kumarv14](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kumarv14](https://community.dynatrace.com/u/kumarv14)\
**Post date:** [January 30, 2026, 11:08am UTC](https://community.dynatrace.com/t/result-in-percentage-of-service-in-a-single-query/54657/4 "2026-01-30T11:08:38Z")

</div>

Hello ,

I wants to check these counts in last 7 days but wants days in column and hours in row side , how is it possible ? currently using below query .

fetch logs, scanLimitGBytes:-1  
| filter dt.system.bucket==“custom” and index == “db”  
| filter Market==“India”  
| filter TransactionType == “Authentication”  
|fieldsAdd Date = formatTimestamp(timestamp, format: “yyyy-MM-dd: hh” )  
|summarize count() ,by:{Date}

 ![kumarv14_0-1769771167383.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/4/5400ccbde48ffd1f6b9c0ceb30a41d5fb7c216c4.png)

Thanks
