在DolphinDB GUI内执行下面代码:
def yoy_continuous_validation(X, threshold, validation_way, continuous_len){
if (not(string(validation_way) in ['>','>=','<','<=','='])){
return NULL
}
m = parseExpr("iif(msum(iif(yoy(X)" + iif(string(validation_way) == "=","==",validation_way) + "threshold,1,0),continuous_len) == continuous_len,1,0)").eval()
return m
}
报错SQL context is not initialized yet,parseExpr拼接的语句为
iif(msum(iif(yoy(X)>threshold,1,0),continuous_len) == continuous_len,1,0)
直接执行不会报错,是什么原因?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…