Expand my Community achievements bar.

SOLVED

How to add calculated filed in schema to add join in schemas with conditions

Avatar

Level 5

Hello All,

 

I am stuck in a requirement where I have to do Join of schemas with condition in adobe campaign classic like this:

Do I need to use calculated filed to achieve this

IF iBrandId = 0 then iBranchId=999999

else JOIN

customers.iBranchId =orders.iEntityId

 

Please suggest how can we do Join of schemas with condition or Calculated fields in adobe campaign classic like this

please provide some examples

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @Shruti1,

 

I share with you some useful documentation links to solve your issue:

Schemas 

Schema reference 

 

Besides I give you a solution as a guidance, creating a calculated field:

 

<computedExpr expr="iBrandId == 0 ? 999999 : iEntityId"/>

 

Regards, 

Celia

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @Shruti1 

 

You will have to break this in two parts.

 

Part1: Decide the Branch ID. Use the enrichment to create a calculated field and use If condition to set the branch ID to 0 or 999999

Iif(iBrandId ='0',9999999 ,iBrandId )

 

Now you can use the enrichment to set the join base branchId without any additional conditions


     Manoj
     Find me on LinkedIn

Avatar

Level 5

@_Manoj_Kumar_  thanks for your reply but I got the requirement to add this at schema level-in EDIT tab of schema

 

Condition:

IF iBrandId = 0 then iBranchId=999999

else JOIN customers.iBranchId =orders.iEntityId

 

could you please suggests something

Avatar

Correct answer by
Level 7

Hi @Shruti1,

 

I share with you some useful documentation links to solve your issue:

Schemas 

Schema reference 

 

Besides I give you a solution as a guidance, creating a calculated field:

 

<computedExpr expr="iBrandId == 0 ? 999999 : iEntityId"/>

 

Regards, 

Celia

 

Avatar

Level 5

Hi,

 Have you tried this attribute dstFilterExpr? I won’t suggest to have static values in the join links. But you can try to use you don’t find any other options. You need to have 2 links.

 

 <element name="orders" type="link" label="MyLink" target="cus:orders">
<join xpath-dst="@entityid" xpath-src="’999999’" dstFilterExpr="@branchid = '0'"/>
</element>

 

<element name="orders" type="link" label="MyLink2" target="cus:orders">
<join xpath-dst="@entityid" xpath-src="@branchid" dstFilterExpr="@branchid != '0'"/>
</element>