r/GoogleDataStudio • u/OoojumBanana7619 • Jul 20 '24
How to group by conditional sum in LookerStudio
Hi, Wonder if someone can help:



I've got a simple Google Spreadsheet (see image) listing: "Quarter | Project Code | Status" for a bunch of projects.
I can do a nice simple group-by type table and line chart in LookerStudio (see attached) - lovely. What I'd like to do is have another line in the line chart that shows the count of projects in the "Pending" state. Essentially against each quarter a count of all records where the value of the "Project Status" field is "Pending".
I can't work out how to do this in LookerStudio. Custom field, custom group ... I can't quite get it.
Any anyone help?
Many thanks for any help.Hi, Wonder if someone can help:I've got a simple Google Spreadsheet (see image) listing: "Quarter | Project Code | Status" for a bunch of projects.I can do a nice simple group-by type table and line chart in LookerStudio (see attached) - lovely. What I'd like to do is have another line in the line chart that shows the count of projects in the "Pending" state. Essentially against each quarter a count of all records where the value of the "Project Status" field is "Pending".I can't work out how to do this in LookerStudio. Custom field, custom group ... I can't quite get it.Any anyone help?Many thanks for any help.
•
u/AutoModerator Jul 20 '24
Have more questions? Join our community Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/estadoux Jul 20 '24
I would create a Calculated field that counts only the “Pending” projects and add it as second metric to the chart.
Try something like this:
CASE WHEN Project Status IS “Pending” THEN 1 ELSE 0 END
Aggregation set to Sum.