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,
click editEdit. 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:
In Ads Data Hub, open the Reports page.
Click the name of the report you want to edit.
Click editEdit
next to Filtered row summary automatically generated.
Click the Automatic toggle to the off position. Note: When automatic
mode is disabled, the current configuration is retained. Edit or delete
these rules as needed.
Aggregate a column using a sum. Note that if the sum falls below aggregation
thresholds, the filtered row summary will be dropped.
Click Add rule
Enter the name of the column to aggregate in the Column name field.
Select Sum from the Type list.
Add a label for the filtered row summary using a constant. Your constant
must be a valid data type for your chosen column.
Click Add.
Decide in which column of the filtered row summary you want the
identifier to appear, then enter the name of that column in the Column
name field.
Select Constant from the Type list.
Enter a helpful identifier for the row, such as "Filtered row summary",
in the Specify constant field.
Click Done.
Click Save to commit your changes.
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 summary; if the summary itself falls below the thresholds, it will be dropped, but a warning will appear in the job status.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually configure filtered row summaries by adding rules to specify how columns should be aggregated (sum or constant) for the summary row.\u003c/p\u003e\n"],["\u003cp\u003eWhen exporting multiple tables using in-sql syntax, you can add a filtered row summary using column options like \u003ccode\u003emerge_type\u003c/code\u003e and \u003ccode\u003emerge_constant\u003c/code\u003e.\u003c/p\u003e\n"]]],["Filtered row summaries aggregate data from rows dropped due to privacy checks, preventing discrepancies in totals. These summaries, enabled by default in UI-created analysis queries, combine filtered rows using sums and constants. Automatic mode configures summaries dynamically, while manual mode allows custom setup via sums and constant labels. For multiple tables, `merge_type` sums values and `merge_constant` sets a value in the summary. If the resulting summary fails privacy checks, it's also filtered, but with a warning. Using noise instead of difference checks can make filtered row summary unnecessary.\n"],null,["# Filtered row summary\n\n\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/marketers/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/marketers/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\n### Example\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--------------\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, click edit **Edit**. 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/marketers/reference/rest/v1/customers.analysisQueries#resource:-analysisquery).\n\nManual mode\n-----------\n\nWe recommend using automatic mode. To manually add a filtered row summary\nto a saved query, or after disabling automatic mode:\n\n1. In Ads Data Hub, open the Reports page.\n2. Click the name of the report you want to edit.\n3. Click edit **Edit** next to **Filtered row summary automatically generated**.\n4. Click the **Automatic** toggle to the off position. Note: When automatic mode is disabled, the current configuration is retained. Edit or delete these rules as needed.\n5. Aggregate a column using a sum. Note that if the sum falls below aggregation thresholds, the filtered row summary will be dropped.\n 1. Click **Add rule**\n 2. Enter the name of the column to aggregate in the **Column name** field.\n 3. Select **Sum** from the **Type** list.\n6. Add a label for the filtered row summary using a constant. Your constant must be a valid data type for your chosen column.\n 1. Click **Add**.\n 2. Decide in which column of the filtered row summary you want the identifier to appear, then enter the name of that column in the **Column\n name** field.\n 3. Select **Constant** from the **Type** list.\n 4. Enter a helpful identifier for the row, such as \"Filtered row summary\", in the **Specify constant** field.\n7. Click **Done**.\n8. Click **Save** to commit your changes. \n\nManual mode with multiple tables\n--------------------------------\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/marketers/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)."]]