NRQL: get value diff between two time points

Good day New Relic community!

I’m trying to build a chart (and probably an alert) to track the difference between infra daily costs this moth and the previous month.

From the visualisation point of view one can use COMPARE WITH clause to compare two charts visually.
But to build an alert we need to get the actual diff between current value an the value a month (week, day, etc.) ago.

Is it possible to do it with NRQL?

Might make more sense to alert off targets rather than some relative number from the past. Wont you have weird issues over time?

You can use some of the date functions and filters to achieve some specific compares and use math.

filter(count(*), where monthOf(timestamp) = ‘September 2020’)…

@arkady.dyakonov Hope the guidance from 6MM ^^ helped you out. Let me know if you need further assistance :slight_smile:

@JoiConverse indeed, it helped. I somehow missed notification from discussion board.

@6MM Thanks a lot!

1 Like