Hi,
i have three tables lets call them dt_A, dt_B and dt_C. Data from tables dt_A and dt_B are either uploaded or concatenated into dt_C.
Since the data from dt_A or dt_B can be added into dt_ C by different users and can be generated at different times. Therefore, in order to avoid multiple adds into C, I have decided to check first if those already exists. My idea was simple:
date = dt_A:Name("measurement date")[i];
lot = dt_A:Lotname[i];
wafer = dt_A:WaferNumber[i];
chip = dt_A:Position[i];
for each row(
if(:Name("measurement date") == date & :Lotname == lot & :WaferNumber == wafer & :Position == chip, a = 1, a = 0);
);
// a = 1 if the values are found
// a= 0 if the values are not found
and here comes the issue that I faced. I have generated number of data in dt_A, some of those are already in the available in dt_C. Even if the condition is true, a =1, the result is a = 0.
However, when i run:
dt_C << select where(:Name("measurement date") == date & :Lotname == lot & :WaferNumber == wafer & :Position == chip);
the row in dt_C is selected.
Any ideas where the problem lies?
i have made some work around, and since the select function works without issues, therefore my solution was simply:
dt_C << Select Where(
:Name( "measurement date" ) == date:Lotname == lot & :WaferNumber == wafer & :Position == chip
);
If( N Rows( dt_C << get selected rows ) > 0,
a = 1,
a = 0
);
in this case the program always returns correct "a" value. And the further concept either concatenating or updating the data works without issues