Dynamic Shift #725
Answered
by
tibdex
EricDallAgnol
asked this question in
Q&A
Dynamic Shift
#725
-
Beta Was this translation helpful? Give feedback.
Answered by
tibdex
Dec 6, 2022
Replies: 1 comment 1 reply
-
Hi Eric, Indeed, passing measures to tt.switch(
m["date_diff"],
{
-1: tt.date_shift(m["VaR"], h["RiskDate"], offset="P-1D"),
0: m["VaR"],
...,
5: tt.date_shift(m["VaR"], h["RiskDate"], offset="P5D")
}
) You could even create the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
EricDallAgnol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Eric,
Indeed, passing measures to
date_shift()
orshift()
's offset parameter is not supported. As a workaround, if you have a small set of known in advance different offsets (let's say around 10), you could do something like that:You could even create the
switch()
cases with a dict comprehension to have less things to type.