[英]How to pass Data Studio Controls to BigQuery custom query
I have the Data Studio Report in which I have Date and Task Controls.我有 Data Studio 报告,其中有日期和任务控件。
I am using custom BigQuery and have already set the date Control via date between @DS_START_DATE and @DS_END_DATE
but I also need to set Task in the custom query.我正在使用自定义 BigQuery 并且已经通过
date between @DS_START_DATE and @DS_END_DATE
的日期设置日期控制,但我还需要在自定义查询中设置任务。
Note: I cannot use the parameter like Task = @Task because Task is a Control while adding parameter(@Task) is a completely different thing.注意:我不能使用像 Task = @Task 这样的参数,因为 Task 是一个控件,而添加参数(@Task)是完全不同的事情。
Update: The task is not a first-level filter.更新:该任务不是一级过滤器。 Somehow I need it to pass it in the subquery.
不知何故我需要它在子查询中传递它。 I can pass the date in subquery via @DS_START_DATE and @DS_END_DATE but cannot do the same with Task.
我可以通过@DS_START_DATE 和@DS_END_DATE 在子查询中传递日期,但不能对 Task 做同样的事情。
Thanks in advance:)提前致谢:)
Unless there is a specific requirement, your setup as it is should work.除非有特定要求,否则您的设置应该可以正常工作。 I'm assuming
Task
is a field in your data.我假设
Task
是您数据中的一个字段。 When the report viewer picks one or more values from the Task
filter control, Data Studio will send the query to BigQuery with appropriate filter clause.当报告查看者从
Task
筛选器控件中选择一个或多个值时,Data Studio 会使用适当的筛选器子句将查询发送到 BigQuery。 You can confirm this by looking at the billing project's query history in BigQuery.您可以通过在 BigQuery 中查看计费项目的查询历史记录来确认这一点。
Edit(since OP has a specific requirement to add the parameter):编辑(因为OP有添加参数的特定要求):
task
parameter in your data source.task
参数。 ( how to ) This can be text or single select . WHERE
clause: WHERE task = @task
WHERE
子句: WHERE task = @task
task
parameters.task
参数。 This post has a similar example in the Creating parameterized custom queries section. 这篇文章在创建参数化自定义查询部分有一个类似的例子。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.