Tuesday, 12 February 2019

How to Link two data sets without using any Join [group link or group filter]

Example

Data Set 1:

select cash_receipt_id, created_by from ar_cash_receipts_all

Create a group: G_RECEIPT

Edit created by property against the property icon:

Column Name
*AliasP_CREATED_BY
Display NameP_CREATED_BY
Data Type
Sort Order
Value If Null

Now create another dataset and use it as bind variable [:P_CREATED_BY]

Data Set 2:

SELECT 
CASE 
WHEN (SELECT COUNT(*) FROM PER_USERS WHERE USERNAME = :P_CREATED_BY AND PERSON_ID IS NOT NULL) > 0 THEN 
(SELECT distinct 
ppn.full_name||' ('||papf.person_number||')'
FROM
    per_users u,
    per_all_people_f papf,
    per_person_names_f ppn
WHERE
    papf.person_id = nvl(u.person_id,-1)
    AND ppn.person_id = papf.person_id
    AND trunc(SYSDATE) BETWEEN nvl(papf.effective_start_date,trunc(SYSDATE) ) AND nvl(papf.effective_end_date,'4712-12-31')
    AND trunc(SYSDATE) BETWEEN nvl(ppn.effective_start_date,trunc(SYSDATE) ) AND nvl(ppn.effective_end_date,trunc(SYSDATE) )
    AND ppn.name_type = 'GLOBAL'
AND U.USERNAME = :P_CREATED_BY
AND ROWNUM =1)
ELSE 
(SELECT USERNAME FROM PER_USERS WHERE USERNAME = :P_CREATED_BY)
END FULL_NAME

FROM DUAL


You will get a prompt to create this variable as parameter, just ignore same. 

[This way both dataset will be linked without actually creating a group link or group filter]

1 comment:

  1. Oracle Apps R12 and Fusion Cloud Self Paced Training Videos Published on Udemy with Live Meeting Support. Please Check https://www.oracleappstechnical.com

    ReplyDelete