Parametrize GROUP BY query based on WF variable


I would like to formulate an SQL query in a “Query” processor, so that I would be able to GROUP BY according to all columns contained in a WF variable, and count (*) based on the GROUP BY columns. How would I go about to do that?

My idea was that the query should have looked like the following

Definition of the Workflow variable:

wf_variable_name = a,b

SELECT  @wf_variable_name@, count(*) as count_entries_per_key FROM inputTable i
GROUP BY @wf_variable_name@

Unfortunately though, this doesn’t seem to work, as the column names do not get resolved from the WF variable.

make sure that you are using the technical workflow variable name

1 Like

Thanks, now it’s working. Just had to double-check the technical name of the WF variable I was using. Finally understood what the technical name of a WF variable is used for :laughing:

1 Like