Setting project variables from SQL output

Solved!
Bader
Level 3
Setting project variables from SQL output

Hi all,  

I'm trying to select max value from sql query and set the output into project variables

I have done the following from scenario: 

1- Execute SQL as a step. 

2- I'm tying to use result from previous step to set the project variables   

example:  

The following is my variable  

{  "Max_order": "4"}. 

1- Following is my query. 

select max(orderNumber) from ordertable 

the result is :5 

2- set the project variables 

i expect the following : 

{  "Max_order": "5"}. 

1 Solution
Alex_Combessie
Dataiker Alumni

Hi,

To use the results from a previous scenario step, you need to parse the results. In the case of a SQL scenario step, this page should help you: https://doc.dataiku.com/dss/latest/scenarios/variables.html#using-the-results-of-a-previous-sql-step

Cheers,

Alex

View solution in original post

1 Reply
Alex_Combessie
Dataiker Alumni

Hi,

To use the results from a previous scenario step, you need to parse the results. In the case of a SQL scenario step, this page should help you: https://doc.dataiku.com/dss/latest/scenarios/variables.html#using-the-results-of-a-previous-sql-step

Cheers,

Alex