Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
| CatalogueId | ParentCatalogueId | Wave | Score | InheritedWave | InheritedScore |
| 1 | 1 | 100 | |||
| 2 | 2 | 100 | |||
| 3 | 1 | 10 | 1 | 100 | |
| 4 | 2 | 35 | 2 | 100 |
Hi,
I got the solution for ur query ,i am attaching the qvw file please find the attached and gothrough the script wriiten u will understand the logic.
Cheers,
Ajay
Hi Ajay,
Thanks for your reply. This looks as though this could be the solution. However, some of our fields come from different tables. Would you suggest joining the tables beforehand? Wava and CatalogueId (along with a number of other fields) reside in one table and ParentCatalogueId and Score reside in another.
Hi,
Can u please send me the table structure so that i can verify whether joining the tables results in exactly what u required
Regards,
ajay
Hi Ajay,
We have three tables (first is a mapping table and other 2 are the data sources) :
Response_Mapping:
Mapping Load Distinct (CatalogueID) as CatalogueId,
ResponseText;
select
CatalogueID,
ResponseText
from
dbo.View;
REPTEC_QUESTIONNAIREFACT:
load Distinct (CatalogueID) as CatalogueId,
ParentCatalogueID,
ResponseText,
If(ISNULL(CopiedFromCatalogueID)=-1,ResponseText,ApplyMap('Response_Mapping',CopiedFromCatalogueID,ResponseText)) as InheritedResponseText;
select
CatalogueID,
ParentCatalogueID,
ResponseText,
FROM
dbo.Questionnaire
where ResponseText in ('Compliant','Not Compliant', 'Not Applicable', '');
LtOTable:
LOAD CatalogueID as CatalogueId,
SystemName as LtOApplication,
Wave,
FROM
[$(vServerName).xls] (biff, embedded labels, table is [LtO Data$]);
The score we mentioned previously is a long expression so we chose to map to responsetext instead which we have done. However to create an inheritedwave field is proving more difficult. We want to say, if there is a ParentCatalogueId use this as the CatalogueID and it's corresponding Wave status if it exists.