Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I need some help with load scripts:
I have a standard load script loading some data from excel sheet which is fine, i have a rather complicated if structure to calculate a value, lets call it 'Calculated Value A' which i save to the table structure, this all works great.
However in the same load script i want to access 'Calculated Value A' which I have just created and use it in further calculations, rather than just repeating the whole complicated if structure again is there a way to gain access to the value in the field that has just been created?
Load
line 1
line 2
if ( if ( if ( etc ))) as [Calculated Value A]
if [Calculated Value A] = 'Yes' then do something
From
etc etc
Thanks
JP
No, its correct.
When using pre load all happens bottom to up
Load // this happens affer load below
*,
if [Calculated Value A] = 'Yes' then do something;
Load // this happens first
line 1
line 2
if ( if ( if ( etc ))) as [Calculated Value A]
From
etc etc
Use a 'pre-load'
Load
*,
if [Calculated Value A] = 'Yes' then do something;
Load
line 1
line 2
if ( if ( if ( etc ))) as [Calculated Value A]
From
etc etc
Hi JP
I think you can use the same calculation again but with an extra if statment:
Load
Line1,
Line2,
IF( IF ( IF (ETC))) as [Calculated Value A],
IF( IF( IF ( IF (ETC))) = 'Yes', something, somethingelse) as Somethingnew
From
Etc Etc
I hope this helps.
Michel
Thanks Michel thats the solution I had but i thought it was rather messy and there had to be a better way.
Hi Anjos
This looks sensible thanks, is the syntax as you have it with the 2 loads? if the script loads top to bottom should you not have it like this:
Load
line 1
line 2
if ( if ( if ( etc ))) as [Calculated Value A]
Load
*,
if [Calculated Value A] = 'Yes' then do something;
From
etc etc
I've not used the pre-load option but you could also do it in 2 tables if you wanted to keep it neater. So you use your first table as a temp table and then calculated off this.
No, its correct.
When using pre load all happens bottom to up
Load // this happens affer load below
*,
if [Calculated Value A] = 'Yes' then do something;
Load // this happens first
line 1
line 2
if ( if ( if ( etc ))) as [Calculated Value A]
From
etc etc
Perfect just tried it and it works a treat.
Thanks a mil for your help.
Cheers
JP
JP,
Would you mind marking this discussion as answered?
I was looking for that yesterday but I can't find it in the new layout ??
Sent from my iPhone