Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vgodoy78
Contributor II
Contributor II

Script Calculation between two separate tables

Hello:

I have loaded two tables:

Tab1 and Tab2

Tab1:

LOAD *,

[Field Value1]&'/'&[Field Value2] as  CONCAT_TAB1;

LOAD

Field Value1 Tab1,

Field Value2 Tab1,

Field Value3 Tab1,

Field Value4 Tab1

FROM

[local file];


Tab2:

LOAD *,

[Field Value1]&'/'&[Field Value2] as  CONCAT_TAB2;

LOAD

Field Value1 Tab2,

Field Value2 Tab2,

Field Value3 Tab2,

Field Value4 Tab2

FROM

[local file];


This works great, however I now want to perform some calculations between the to CONCAT_TABx fields I have created.

I have successfully done the calculation in a chart expression but would like to do it in the script.


Essentially, I would like to know the syntax to select the fields from the two Tables.


I would like to do the following:

Example 1:

=IF(CONCAT_TAB1=CONCAT_TAB2,'Y','N') as New_Patient

Example 2:

=IF([Field Value1_Tab1]>1 and [Field Value3_Tab2]=0,'Y','N') as External_Provider


Can someone provide insight on how to achieve this within the script rather than a chart expression?

Thanks,

Varinia

1 Reply
Gysbert_Wassenaar

Join the tables so all the fields necessary for the calculation exist in one table. That's the only way.


talk is cheap, supply exceeds demand