Highlighted

How to pick up current DELIVERY id in a DELIVERY report workflow

salvdangelo

22-09-2017

Hi everyone,

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

Vipul RaghavAmit_Kumar

Jean-Serge Biron

Adhiyan

@nkur

Adobe Campaign

Replies

Highlighted

Amit_Kumar

MVP

24-09-2017

Hi, Salvator,

In Adobe campaign this is controlled via context in reports, and this is the recommended way.

Read this here: Using the context

1309451_pastedImage_0.png

query activities in reports let you filter automatically using context like above.

let me know if you are getting stuck at any point.

Regards,

Amit

Highlighted

salvdangelo

25-09-2017

Hi Amit,

"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).

Any suggestion?

Report1.JPG

Report2.JPG

Thanks,
Salvatore

Amit_Kumar

MVP

25-09-2017

Hi, Salvatore,

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:

<_contextFilter>

    <where>

      <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" />

    </where>

  </_contextFilter>

Regards,

Amit

Highlighted

salvdangelo

25-09-2017

Hi Amit,

ERRATA CORRIGE

It looks  like the same!

<_contextFilter>\n" +

"    <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" +

"  </_contextFilter>

Amit_Kumar

Highlighted

Jean-Serge_Biro

MVP

25-09-2017

Hi Salvatore,

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.

Debugging reports is sometimes tedious task, so I recommend you to add some Javascript activity between each other activity (page, query) and writes some logInfo in the JS activity. In addition of Debug mode and examining XML context, it greatly helps to understand some tricky issues.

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?

Regards

J-Serge

Highlighted

salvdangelo

26-09-2017

Hi Jean-Serge,

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"

Highlighted

Jean-Serge_Biro

MVP

28-09-2017

Hi Salvatore,

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.

Regards

JS

Highlighted

salvdangelo

28-09-2017

Hi Jean-Serge,

I usually test the report both in preview mode and through report option on the single delivery, no change between these modes.

Salvatore