Reusing user prompts in Freehand SQL
Answered
Is it possible to reuse a user prompt in Freehand SQL?
Context
I have multiple subqueries which are supposed to use the same user prompt. For example
(Select user_id, SUM(field1) FROM users WHERE insert_date <= {end_date} GROUP BY user_id) u1 INNER JOIN (select user_id, field2, field3 FROM users WHERE insert_date = {end_date)) u2 ON u1.user_id = u2.user_idIn this case, end_date is a user input . If i use {?} as the user guide recommends, the user gets asked for end_date twice. This makes the filters redundant and gives users the chance of putting in different dates (which messes up the query logic). Is there a way to perhaps name a user prompt, as above, so that it can be reused in queries?
My understanding is that Yellowfin supports multiple statement execution freehand sql for many DBs although not all.
If what you are using is one of them, something like the below might work for you (will likely need to adapt based on your DB's syntax). The idea being that you use a variable to set the parameter and the query engine does the substitution for you. That way, you only need to set it once and so Yellowfin only displays 1 user prompt
My understanding is that Yellowfin supports multiple statement execution freehand sql for many DBs although not all.
If what you are using is one of them, something like the below might work for you (will likely need to adapt based on your DB's syntax). The idea being that you use a variable to set the parameter and the query engine does the substitution for you. That way, you only need to set it once and so Yellowfin only displays 1 user prompt
Hi Carine,
Are you able to confirm this query works outside Yellowfin, using the same JDBC driver and connection parameters? Can you narrow it down to a particular element of the query? I have not seen a"declare" statement used in freehand SQL content before for example, this might be contributing to thie issue. If so I may be able to get a bug to developers.
Thanks,
Eric
Hi Carine,
Are you able to confirm this query works outside Yellowfin, using the same JDBC driver and connection parameters? Can you narrow it down to a particular element of the query? I have not seen a"declare" statement used in freehand SQL content before for example, this might be contributing to thie issue. If so I may be able to get a bug to developers.
Thanks,
Eric
Hi Carine,
Just wanted to check in to see if you had a chance to review my reply at this time.
Thanks,
Eric
Hi Carine,
Just wanted to check in to see if you had a chance to review my reply at this time.
Thanks,
Eric
Hi Carine,
I'm going to go ahead and mark this question as Answered due to inactivity at this time. Feel welcome to reach out in the future.
Thanks,
Eric
Hi Carine,
I'm going to go ahead and mark this question as Answered due to inactivity at this time. Feel welcome to reach out in the future.
Thanks,
Eric
Replies have been locked on this page!