(result: 22 rows) (exactly same as input of query_1)
All I've done is, wrap the above query directly inside another cs_window_ema, but that seems to have ignored all the shifts I've done inside and returns 39 rows which are incorrect (supposed to be just 14 rows) and so are the values since we're doing EMA where the values change based on where I start the first window from.
Does nested window function work differently? For example, irrespective of the changes in the shifts (<<) for the inner time series output from cs_window_ema, the final result stays the same at 39 rows - how can this be possible? Shouldn't the no. of rows be 14 (same as query_1) since we are already shifting the inner timeseries by 25?. Do nested window functions ignore inner shifts?
Hi,
I'm having some difficulties understanding window functions. I'll explain using examples below:
My question: I expect the result of
query_1
andquery_2
should be the same (in terms of no. of rows and the actual values), but it's not. Why?(Note: the reason I've used
cs_project
in the below queries is to just make comparison easier due to row-by-row alignment of values)query_1
: (input size: 22 rows)(result: 14 rows)
query_2
:(result: 39 rows)
The array in
query_1
is actually just the result of the difference between the 2 ema's as inquery_2
. i.e,query_1
's numbers are from:(result: 22 rows) (exactly same as input of
query_1
)All I've done is, wrap the above query directly inside another
cs_window_ema
, but that seems to have ignored all the shifts I've done inside and returns 39 rows which are incorrect (supposed to be just 14 rows) and so are the values since we're doing EMA where the values change based on where I start the first window from.Does nested window function work differently? For example, irrespective of the changes in the shifts (<<) for the inner time series output from
cs_window_ema
, the final result stays the same at 39 rows - how can this be possible? Shouldn't the no. of rows be 14 (same asquery_1
) since we are already shifting the inner timeseries by 25?. Do nested window functions ignore inner shifts?