07 Jul 2024 07:05 PM
I have the following DQL query:
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
Solved! Go to Solution.
07 Jul 2024 08:56 PM
Hi @badgerfifteen
iCollectArray is the function which allows iterative operations on the Arrays in DQL.
In your case something like this would help
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