# Divide each value by a specific number in an array - DQL

**URL:** <https://community.dynatrace.com/t/divide-each-value-by-a-specific-number-in-an-array-dql/46492>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [July 7, 2024, 6:05pm UTC](https://community.dynatrace.com/t/divide-each-value-by-a-specific-number-in-an-array-dql/46492 "2024-07-07T18:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![badgerfifteen](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@badgerfifteen](https://community.dynatrace.com/u/badgerfifteen)\
**Post date:** [July 7, 2024, 6:05pm UTC](https://community.dynatrace.com/t/divide-each-value-by-a-specific-number-in-an-array-dql/46492/1 "2024-07-07T18:05:09Z")

</div>

I have the following DQL query:

```markup
timeseries interval: 1d, usage = sum(dt.billing.full_stack_monitoring.usage), from: -7d, to: now()

```

Essentially, what I want is to divide each value within the array by a specific amount which would then give me my costing under the DPS model.

What DQL function do I use to divide each value within an array

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [July 7, 2024, 7:56pm UTC](https://community.dynatrace.com/t/divide-each-value-by-a-specific-number-in-an-array-dql/46492/2 "2024-07-07T19:56:56Z")

</div>

Hi&nbsp;[@badgerfifteen](https://community.dynatrace.com/user/67521)&nbsp;  
iCollectArray is the function which allows iterative operations on the Arrays in DQL.  
In your case something like this would help

```markup
timeseries interval: 1d, usage = sum(dt.billing.full_stack_monitoring.usage), from: -7d, to: now()
| fieldsAdd actual_usage=iCollectArray(usage[]/100)

```

Just dividing by 100 here to give an example.

Regards,  
[@Maheedhar\_T](https://community.dynatrace.com/user/76275)
