Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Script Help

I have an inline table that I load that has a field called 'Value' that contains a target or goal.

I then load my data from another source.

The challenge I am having is that I then want to use the Value field from the resident table in an expression with the fields from my other data.

I keep getting an error that it can't find 'Value' when it tries to execute the expression.

The inline table and my data are linked via a key that I create.

I was thinking that I could load each of the tables.  Then combine the 2 resident tables into one table and do the calculation.  But I can't get that to work.

I am at work and don't have the code I was trying to give you an example.  If this is not an obvious answer then I can add that later today.

Thanks

4 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi

Please add and example to be easier to help you

Fernando K.

rittermd
Master
Master
Author

Here is the code that I was trying.

This part of the code works.

But as soon as I add Value from the first Resident table to be part of an expression I get an error that it can't find that field.

Noconcatenate 

 

MergeTable: 

LOAD Metric_Key,

     Value

 

resident Final_Metrics; 

 

JOIN (MergeTable)

 

LOAD *,

   Num(((Num([On Scene Time]) - Num([Pickup Date/Time]))*60*24),'###.00') as Response_Time

resident Run_Data; 

 

Drop Table Final_Metrics, Run_Data;

ahaahaaha
Partner - Master
Partner - Master

Hi Mark,

Which field name is indicated in the error message?

Regards,

Andrey

rittermd
Master
Master
Author

I actually came up with a solution that works.

I just added another resident load at the end of the MergedTable and then did the calculation that I needed there.  I don't know if that is the best way to do it.  But it worked for me. 

I don't have a massive amount of data to deal with.  So I don't have to be too concerned about being efficient.