05-03-2017 3:50 AM - edited 02-03-2024 9:21 PM
I created a flow graph batch task with variables as from date and to date and we are using the variables to filter the data in the flow graph.
As we want to run/schedule the flow graph every day with from date = currentdate -1 and to date = current date. Is there a way to pass the from and to date values dynamically.
Thanks
Srini
Hi Srini,
you can use expression variables to form the appropriate filter expressions.
Inside those variables you can use hana functions like CURRENT_DATE to make it dynamic.
e.g. variable nextDay with value ADD_DAYS(TO_DATE(CURRENT_DAY),1);
in the filter expression you can access it using $$nextDay$$
Kind regards,
Timo Wagner
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I want to do exactly the same but as I have several flowgraphs that need to be started with the same date, I would like to define the variable in the stored procedure, in order to have to input it once for all the flowgraphs. So, I defined a stored procedure where the value of my flowgraph variable is set. However, I cannot pass value of CURRENT_DATE from my stored procedure into my flowgraph. It is giving me '1998'. Four days ago, it was giving me '2002'. How is this possible?
EXEC 'START TASK "<SchemaName>"."1_Flowgraphs::ZTEST_VARIABLE_FLOWGRAPH"("DATE" => ''' ||CURRENT_DATE||''' )'; is giving me "1998" as $$DATE$$.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Could you share the source of the procedure?
My problem is similar...I want to filter records modified last 10 days.I defined variable in Filter Transformation, but can't pass result from ADD_DAYS(TO_DATE(CURRENT_DATE),-10).
Thanks!
Ivaylo Ivanov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We created a wrapper for the flow graph and population the date values with in the procedure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.