I am using a delivery report and in particular a query activity with a custom schema (containing delivery iDs in particular).
In "where condition" I would filter the records for the current delivery (SCHEMA.deliveryId = <currentDeliveryId>)
Someone could tell me how to do this?
Maybe it's a simple issue.
Thanks for helping!
Note: I am not using cube
In Adobe campaign this is controlled via context in reports, and this is the recommended way.
Read this here: Using the context
query activities in reports let you filter automatically using context like above.
let me know if you are getting stuck at any point.
"Filter automatically with the context" is already flagged but I still see ALL THE RECORDS unfiltered for delivery id.
The same outcome if I flag in addition "limit the selected records" (limit to 1000 --> ALL THE RECORDS, limit to first record --> NO RECORD AT ALL).
Are you using "Descriptive analysis" report or Adhoc Reports?
Can you enable the debug for this report of yours and check if you have _contextFilter? If you have this in your example post the inner XML from _contextFilter here?
It should be like this:
<condition expr="@id = $noescaping(@_selection)" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) = false" />
<condition expr="@id" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) and $(@_locationName) != 'descriptiveAnalysis'" subQuery="$(whereCond)" setOperator="IN" />
It looks like the same!
" <where>\n" +
" <condition enabledIf=\"$(@_context) = 'selection' and $(@_hasFilter) = false\" expr=\"@id = $noescaping(@_selection)\"/>\n" +
" <condition enabledIf=\"$(@_context) = 'selection' and $(@_hasFilter) and $(@_locationName) != 'descriptiveAnalysis'\" expr=\"@id\" setOperator=\"IN\" subQuery=\"$(whereCond)\"/>\n" +
" </where>\n" +
Besides of what Amit suggested, filter by context (which is a powerful mean for filtering data) from interactive input flow, even with the standard query you should not have issue to select/filter the records targeted with the method you took.
In your case, you could check dimensions variable values in debug context, before submitting the form: after selecting the value probably in a list, you must select/focus another field in order that the context variable value is reflected correctly.
It usually greatly helps.
But if the problem is the list constituted in your form, so the dimensions variable value remains empty, you should add some logInfo to better understand. By the way, is the list made of static values of another query/context values in advanced tab?
vars.dimension is set through a drop-list (combo box) inside the page element. This drop-list has a series of static values.
The query activity uses a filter SCHEMA.dimension = vars.dimension that works
In addition, I should have a filter like SCHEMA.deliveryId = <ctx.deliveryId> but as suggested by you it should be done just with that flag "Filter automatically with the context"
Regarding filtering on context
Please may you tell us how you execute the report?
Are you calling the report being on a delivery (Reports section of the delivery dashboard) ?
Or equivalent manner, by selecting the delivery in Preview mode instead of Global radio button?
I would like to be sure that the delivery.id is passed by parameter/filter by context as you meant it.