Hi Mirza,
Above scenario can be achieved using two calculation views. One view to provide the look up values for LANG for each of the ParentKey and another to fill the LANG column for rest of the ParentKey by using the look up value from the latter Calculation view.
Let us take the same example which you have mentioned above and create a column table first as shown below :
CREATE COLUMN TABLE HE2E_USER."SCN_1" ("KEY" VARCHAR(1000),
"PK" VARCHAR(1000),
"LANG" VARCHAR(1000),
"NUMBER" INTEGER CS_INT)
and insert the values accordingly :
insert into "HE2E_USER"."SCN_1" values('col1','P001','EN',100)
;
insert into "HE2E_USER"."SCN_1" values('col2','P002','DE',120)
;
insert into "HE2E_USER"."SCN_1" values('col3','P003','FR',60)
;
insert into "HE2E_USER"."SCN_1" values('col4','P001','?',80)
;
insert into "HE2E_USER"."SCN_1" values('col5','P001','?',60)
;
insert into "HE2E_USER"."SCN_1" values('col6','P003','?',100)
Step1 : Let us first create the base CV which can be used for look up purpose.
Create a new CV of DIM type and add another projection node to the existing default projection node and insert the above created column table to the added projection node and select PK and LANG columns as the output columns of the node as is shown below :
Step2 : Now Go to filters section and create a filter for LANG column using the expression :
(not isNull("LANG"))
as is show in the below image :
Step 3: Now add the 2 columns to the semantics and activate the CV and check for its data preview.
It must be similar to the below result set :
Now we have our look up value ready.
Step 4: Create another CV of Dimension type now and add a join node the view.
To the join node add the above created CV and the base table as is shown below and join on the PK column. Once done , add KEY, PK and NUMBER column from the base table and LANG column from the above created view as the set of output columns as is shown below
Step5 : Once done, add the same columns to the semantic and preview the view by activating it.
You must now get the desired result set that fills the rest of the values in LANG column as is shown below :
Hope you find it useful.
Thanks and Regards,
Poorna