Keep only rows that meet the condition
mntintchui
Registered Posts: 2 ✭✭✭✭
Hello my name is Michael and I am new to DSS.
Here is variable i create
{
"v_date_m_1": "01-01-2020",
"v_date_m_3": "01-10-2019"
}
then in the PySpark recipe i do this:
SELECT *
FROM `table`
where date >= '${v_date_m_3}' and date < '${v_date_m_1}' ;
But nothing in output.
Can you guys tell me what is wrong ?
Best Answer
-
Hi Michael,
you need to grab your variable before you can use it, like so:
import dataiku print "I am filtering %s" % (dataiku.get_custom_variables()["v_date_m_1"])
https://doc.dataiku.com/dss/latest/advanced/variables_expansion.html#python
Answers
-
Thanks Jediv!