From 293f0b93c60c1f01d9f884a208eecf5389f9e10e Mon Sep 17 00:00:00 2001 From: jaegeunha Date: Thu, 12 Dec 2024 01:24:18 +0000 Subject: [PATCH] At #546 Add offset 1 for difference function in Canned Graphs --- frontend/src/utils/buildQueriesForLayouts.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/utils/buildQueriesForLayouts.ts b/frontend/src/utils/buildQueriesForLayouts.ts index eafc7250..673e8ecf 100644 --- a/frontend/src/utils/buildQueriesForLayouts.ts +++ b/frontend/src/utils/buildQueriesForLayouts.ts @@ -94,7 +94,12 @@ const buildCannedDashboardQuery = ( text += ` group by time(${defaultGroupBy})` } - if (text.includes('non_negative_derivative') || text.includes('derivative')) { + if ( + text.includes('non_negative_derivative') || + text.includes('derivative') || + text.includes('difference') || + text.includes('non_negative_difference') + ) { text += ` offset 1` }