i have 1-N Link.How to call it in query def select condition | Community
Skip to main content
Level 4
April 28, 2023
Solved

i have 1-N Link.How to call it in query def select condition

  • April 28, 2023
  • 3 replies
  • 2164 views

 

 

i have 1-N Link in tables

 

How to call it in query def select condition

 

please help?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AkshayAnand

04/28/2023 7:43:44 PM SCR-160012 Javascript: error while evaluating script 'WKF12218/jsx2'.
04/28/2023 7:43:44 PM SOP-330011 Error while executing the method 'ExecuteQuery' of service 'xtk:queryDef'.
04/28/2023 7:43:44 PM XTK-170036 Unable to parse expression 'BEMEDIA-DCNS_ID'.
04/28/2023 7:43:44 PM Element 'BEMEDIA' unknown (see definition of schema 'Consumer / Touch point profile (elc:BDERIVEDCONSUMER)').

 

========

 

executed what u have pasted but

Gettin this error please help


Hi @shrutii 

 

Apologies for the typo.

var queryOptinBDerivedConsumer = xtk.queryDef.create( <queryDef distinct="true" schema="elc:BDERIVEDCONSUMER" operation="select"> <select> <node expr="@DCNS_ID"/> <node expr="[BRND_ID/@BRND_CODE]" alias="@BRND_CODE"/> <node expr="[consumer/HSLD_ID/@HSLD_HKEY]" a.lias="@HSLD_HKEY"/> <node expr="[sourceConsumerLink/@SRCC_CONSUMERID]" alias="@EMDA_SOURCETIMESTAMP"/> </select> <where> <condition boolOperator="AND" expr="@DCNS_BESTRECORD_TOCH_ID &lt;&gt; 0"/> <condition boolOperator="AND" expr="[neoOptin-DCNS_ID]" internalId="1351616217" setOperator="EXISTS"> <condition boolOperator="AND" expr="BEMEDIA" setOperator = "EXISTS"> <condition expr="@EMDT_CODE = 'emlprs'"/> </condition> </where>

 

Regards

A

3 replies

Marcel_Szimonisz
Community Advisor
Community Advisor
April 28, 2023

Hello @shrutii ,
you can do it two ways:
Exist such as

  • In query condition select (advanced fields, ... on bottom page, if the links are not shown)
  • find your link and double click on it
  • it will create condition exits such as
  • create condition

Filtering dimension

  • In query activity you can select targeting dimension and filtering dimension
  • if the link is configured correctly you should see the linked table in the filtering dimension select
  • create condition to filter you target data

 

First option has lower performance is recommended to use filtering dimension for linked tables

 

Marcel 

ShrutiiAuthor
Level 4
April 28, 2023

@marcel_szimonisz 

an you PLEASE SEDN SAMPLE CODE PLEASE

lets consider t

 

able1 has a,b,c columns--

and table 2 has d,e,f columns

 

and both table1 have 1 to N link with table2

 

please help

Marcel_Szimonisz
Community Advisor
Community Advisor
April 28, 2023

ah ok i did not see that you want xml query def

ShrutiiAuthor
Level 4
April 28, 2023

can you PLEASE SEDN SAMPLE CODE PLEASE

lets consider t

 

able1 has a,b,c columns--

and table 2 has d,e,f columns

 

and both table1 have 1 to N link with table2

 

please help

akshaaga
Adobe Employee
Adobe Employee
May 2, 2023

@shrutii ,

You can call it in a SQL query using a JOIN statement. Here's an example:

Suppose you have two tables: customers and orders.

The customers table has columns customer_id, first_name, and last_name. The orders table has columns order_id, customer_id, order_date, and total_amount.

To select all orders for a specific customer, you can use the following SQL query:

SELECT orders.order_id, orders.order_date, orders.total_amount

FROM orders

JOIN customers ON orders.customer_id = customers.customer_id

WHERE customers.first_name = 'Shruti' AND customers.last_name = 'Abc';

 

This query selects the order_id, order_date, and total_amount columns from the orders table and joins the customers table on the customer_id column.

The WHERE clause filters the results to only include orders for a customer with the first name ‘Shruti’ and the last name "Abc". You can modify the WHERE clause to search for a different customer or use other conditions to filter the results based on your specific needs.