This is legacy documentation, and may not be complete. To see the latest documentation, if you are a marketer, refer to the Marketers site. If you are a measurement partner, refer to the Measurement Partners site.
Stay organized with collections
Save and categorize content based on your preferences.
Rows that aren't adequately aggregated to protect end-user privacy, or don't
meet Ads Data Hub's other privacy
checks, will be dropped from the
results of a given query. You can configure a filtered row summary in analysis
queries to return a single row containing constants and sums from dropped rows.
This can help prevent discrepancies in your data totals, such as a total
impression or total click count. A filtered row summary is enabled by default
for new analysis queries created using the UI. Filtered row summaries don't
apply to audience queries. Queries created using the API don't have a filtered
row summary enabled by default.
Example
In the following example, the rows containing campaigns 124 and 125 would be
filtered, as they don't meet the 50-user aggregation requirement.
Campaign ID
Users
123
400
124
45
125
6
However, using a filtered row summary, the filtered data can be combined to meet
the 50-user aggregation requirement. This example uses a sum to tally filtered
data, and a constant to label the row:
A sum that aggregates filtered data from the Users column.
A constant (used to label the filtered row summary), set to "Filtered row
summary" in the Campaign ID column.
Campaign ID
Users
Filtered row summary
51
123
400
Automatic mode
We recommend using automatic mode. By default, Ads Data Hub automatically
enables and configures a filtered row summary for new queries created using the
UI. As you edit the query, Ads Data Hub will automatically adjust the
configuration, based on the selected columns.
To view the automatically configured settings when viewing a report,
go to Properties > Filtered row summary. The configuration is read-only.
To disable automatic mode, click the Automatic toggle to the off
position. The current configuration is retained and automatic mode is
disabled. You must save your query to retain the change.
To enable automatic mode, click the Automatic toggle to the on position.
You must save your query to retain the change.
We recommend using automatic mode. To manually add a filtered row summary
to a saved query, or after disabling automatic mode:
Identify the column that you would like to aggregate.
Click add Add rule under
Properties > Filtered row summary in the right-hand-side of the query editor.
Enter the name of the column you would like to aggregate in the Column
name field.
Select Sum from the Type drop-down menu. If the sum falls below
aggregation thresholds, the filtered row summary will be dropped.
Optional: Add more rules as you did in the previous steps.
Optional: Add an identifier for the filtered row summary using a constant.
Your constant must be a valid data type for your chosen column.
Enter the name of the column in the**Column name field.
Select Constant from the Type drop-down menu.
Enter an identifier for the row in the Specify constant field.
To remove a rule, click delete
To remove all rules, click close
Remove all.
Manual mode with multiple tables
We recommend using automatic mode. If you are exporting multiple tables using
the in-sql syntax introduced in Exporting multiple
tables, then you can add a filtered
row summary in the column options:
This will produce a result table with a filtered row summary where
the campaign_id is 0 and ct will be the sum of rows that were filtered from the result due to privacy checks.
The available column options for filtered-row summary are:
merge_type="SUM": Outputs the sum of filtered values in the summary row.
Valid only for numeric types.
merge_constant=<value>: Sets a constant value in the summary row. Must
have same type as the column.
columns with no specified option will have NULL in the summary row.
Only one of merge_type or merge_constant may be specified.
Any rules for filtered row summaries apply here, too (i.e. if the sum falls
below the aggregation thresholds, the filtered row summary will be dropped).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-11 UTC."],[[["\u003cp\u003eAds Data Hub uses a filtered row summary to prevent discrepancies in data totals by aggregating data from rows that would otherwise be dropped due to privacy checks.\u003c/p\u003e\n"],["\u003cp\u003eFiltered row summaries are enabled by default for new analysis queries created via the UI but must be manually enabled for queries created via the API.\u003c/p\u003e\n"],["\u003cp\u003eAggregation requirements still apply to the filtered row summaries; if the summarized data doesn't meet the thresholds, it will also be filtered, and a warning message will appear in the job status.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually configure filtered row summaries to specify which columns are aggregated and how, or enable automatic configuration for UI-created queries.\u003c/p\u003e\n"],["\u003cp\u003eWhen exporting multiple tables, you can add a filtered row summary directly in the column options using SQL syntax to specify aggregation behavior.\u003c/p\u003e\n"]]],["Filtered row summaries aggregate data from rows dropped due to privacy checks or insufficient aggregation, preventing data discrepancies. They include sums from filtered rows and constants for identification. Automatic mode configures these summaries by default in the UI, adjusting as the query changes. Manual mode allows custom configuration of columns to aggregate and constants to label the summary. When using multiple tables in a query, filtered row summaries can be defined directly within the table creation. Using noise injection is recommended instead of difference checks.\n"],null,["\u003cbr /\u003e\n\nRows that aren't adequately aggregated to protect end-user privacy, or don't\nmeet Ads Data Hub's other [privacy\nchecks](/ads-data-hub/guides/privacy-checks), will be dropped from the\nresults of a given query. You can configure a filtered row summary in analysis\nqueries to return a single row containing constants and sums from dropped rows.\nThis can help prevent discrepancies in your data totals, such as a total\nimpression or total click count. A filtered row summary is enabled by default\nfor new analysis queries created using the UI. Filtered row summaries don't\napply to audience queries. Queries created using the API don't have a filtered\nrow summary enabled by default.\n| **Key Point:** We recommend using noise instead of difference checks when you run your reports. When you use noise, rows are not filtered due to difference checks, making a filtered row summary unnecessary. To learn more, see [Noise\n| injection](/ads-data-hub/guides/noise-injection).\n| **Important:** Aggregation requirements still apply to filtered row summary columns. If the resulting filtered row summary contains fewer than 50 users, or fewer than 2 rows, the filtered row summary itself will be filtered. However, a message will appear in your job status summary warning you that the filtered row summary was filtered.\n\nExample\n\nIn the following example, the rows containing campaigns 124 and 125 would be\nfiltered, as they don't meet the 50-user aggregation requirement.\n\n| Campaign ID | Users |\n|-------------|-------|\n| 123 | 400 |\n| 124 | 45 |\n| 125 | 6 |\n\nHowever, using a filtered row summary, the filtered data can be combined to meet\nthe 50-user aggregation requirement. This example uses a sum to tally filtered\ndata, and a constant to label the row:\n\n- A sum that aggregates filtered data from the `Users` column.\n- A constant (used to label the filtered row summary), set to \"Filtered row summary\" in the `Campaign ID` column.\n\n| Campaign ID | Users |\n|----------------------|-------|\n| Filtered row summary | 51 |\n| 123 | 400 |\n\nAutomatic mode\n\nWe recommend using automatic mode. By default, Ads Data Hub automatically\nenables and configures a filtered row summary for new queries created using the\nUI. As you edit the query, Ads Data Hub will automatically adjust the\nconfiguration, based on the selected columns.\n\n- To view the automatically configured settings when viewing a report, go to **Properties \\\u003e Filtered row summary**. The configuration is read-only.\n- To disable automatic mode, click the **Automatic** toggle to the off position. The current configuration is retained and automatic mode is disabled. You must save your query to retain the change.\n- To enable automatic mode, click the **Automatic** toggle to the on position. You must save your query to retain the change.\n- To toggle automatic mode with the API, use [`generateFilteredRowSummaryAutomatically`](/ads-data-hub/reference/rest/v1/customers.analysisQueries#resource:-analysisquery).\n\nManual mode\n\nWe recommend using automatic mode. To manually add a filtered row summary\nto a saved query, or after disabling automatic mode:\n\n1. Identify the column that you would like to aggregate.\n2. Click **add Add rule** under **Properties \\\u003e Filtered row summary** in the right-hand-side of the query editor.\n3. Enter the name of the column you would like to aggregate in the **Column\n name** field.\n4. Select **Sum** from the **Type** drop-down menu. If the sum falls below aggregation thresholds, the filtered row summary will be dropped.\n5. Optional: Add more rules as you did in the previous steps.\n6. Optional: Add an identifier for the filtered row summary using a constant. Your constant must be a valid data type for your chosen column.\n 1. Enter the name of the column in the**\\*\\*Column name** field.\n 2. Select **Constant** from the **Type** drop-down menu.\n 3. Enter an identifier for the row in the **Specify constant** field.\n7. To remove a rule, click **delete**\n8. To remove all rules, click **close\nRemove all**. \n\nManual mode with multiple tables\n\nWe recommend using automatic mode. If you are exporting multiple tables using\nthe in-sql syntax introduced in [Exporting multiple\ntables](/ads-data-hub/guides/create-tables#export_multiple_tables), then you can add a filtered\nrow summary in the column options: \n\n```gdscript\nCREATE TABLE `myproject.mydataset.mytable` (\n campaign_id INT64 OPTIONS(merge_constant=0),\n ct INT64 OPTIONS(merge_type=\"SUM\")\n )\nOPTIONS(privacy_checked_export=true) AS\nSELECT campaign_id, COUNT(*) AS ct GROUP BY campaign_id;\n \n```\n\nThis will produce a result table with a filtered row summary where\nthe `campaign_id` is `0` and `ct` will be the sum of rows that were filtered from the result due to privacy checks.\n\nThe available column options for filtered-row summary are:\n\n- `merge_type=\"SUM\"`: Outputs the sum of filtered values in the summary row.\nValid only for numeric types.\n- `merge_constant=\u003cvalue\u003e`: Sets a constant value in the summary row. Must have same type as the column.\n- columns with no specified option will have NULL in the summary row.\n\nOnly one of `merge_type` or `merge_constant` may be specified.\nAny rules for filtered row summaries apply here, too (i.e. if the sum falls\nbelow the aggregation thresholds, the filtered row summary will be dropped)."]]