Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I need to calculate simple division at script level but,the fields from different tables.I have used mapping concept to achieve this. Is this correct approach. when i reloads the script raising error as "Invalid Expression". Can anyone please suggest me where i goes wrong.
PolA:
MAPPING LOAD
TP_BI_ID,
TP_DISC_LC_1 as POL_DISC_LC_1;
FROM
[..\QVD\Pol.QVD]
(qvd);
Risk:
LOAD * ,
(SUM(trim(POL_DISC_LC_1))/COUNT(DISTINCT TR_RISK_SR_NO)) as RISK_DISC_LC_1;
LOAD
TR_BI_ID,
TR_TP_BI_ID,
TR_RISK_SR_NO,
ApplyMap ('PolA',TR_TP_BI_ID,Null()) as POL_DISC_LC_1
FROM
[..\QVD\RISK.QVD]
(qvd);
Regards
Krishna
Hi Michael,
Thank you very much. It's working perfectly !!.I understood my mistake.
One of the reasons I moved applymap() out of the initial load was to make it faster. With this function QVD load is non-optimized.
Ya after moving that apply map and expression in a single line only it's working for me..
Hi,
Sorry i didn't noticed this mistake yesterday. After including Group By clause like above. Risk table is losing it's joining characteristics ,even there is same field in the policy table.Please find the image and suggest me.
Regards
krishna
Hi gwassenaar Sir,
Please guide me why it happens after using Group by clause?
There are no fields that occur in both tables. There's a field TR_BI_ID in the risk table and a field TP_BI_ID in the policy table, but the names are different so it isn't used to link the tables. Perhaps you want to rename one or more fields.
Hi,
In the risk table there is a field TR_TP_BI_ID. It's renamed as TP_BI_ID. you can see in the above attached image.
It is not linking to the policy table.Sorry if i'm wrong.
But in the top load you didn't add that renamed field, so it's not added to the final table. And don't forget to add it to the GROUP BY clause too.
Hi,
Thank you Gysbert for helping in the right time. It's working.Once again thank you very much.