Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
131 views
in Technique[技术] by (71.8m points)

How to filter Analytics data in Data Studio with parameters?

I'm making a report in Data Studio using my Analytics data, and I'm having some trouble finding out how to filter it. Here is what I need to do: I receive a "user" parameter in the URL, and I need to filter my "username" dimension with it. I want to make some kind of filter in the report, like Include usernameDimension = userParameter.

question from:https://stackoverflow.com/questions/65939295/how-to-filter-analytics-data-in-data-studio-with-parameters

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For some limitation in DataStudio, currently it is not possible to directly use Report URL parameters for filtering reports (when you create a filter, it only allows you to select fields, not parameters). However, it is possible to 'hack' this limitation with a new field that references the parameter.

Create a new boolean field called my_filter (or something you wish) with this expression:

field_i_want_to_filter = my_parameter

Then, just create a new filter in your report using this field, with the condition my_filter is true.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...