Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a script that has been running fine for years. today it failed several times and this is the part where there was an error. The script looks good to me but the variables disappeared in the error message and it says I need a ')'. Could anyone show me what is wrong here?
I have checked these variables (vlocalExchangeRateEUR..) and they all return correct values.
Script:
LOAD
PrimaryKey,
If((Org='1000' or Org='1600' or Org='1500') and CurrencyIsoCode='USD', Cost,
If((Org='1000' or Org='1600' or Org='1500') and CurrencyIsoCode='EUR',Cost/$(vLocalExchangeRateEUR),
If((Org='3000') and CurrencyIsoCode='CNY',Cost/$(vLocalExchangeRateCNY),
If((Org='3300') and CurrencyIsoCode='JPY',Cost/$(vLocalExchangeRateJPY)
)))) as CostLC
Resident Quote;
Error message:
Error in expression:
')' expected
Left Join(Quote)
LOAD
PrimaryKey,
If((Org='1000' or Org='1600' or Org='1500') and CurrencyIsoCode='USD', Cost,
If((Org='1000' or Org='1600' or Org='1500') and CurrencyIsoCode='EUR',Cost/,
If((Org='3000') and CurrencyIsoCode='CNY',Cost/,
If((Org='3300') and CurrencyIsoCode='JPY',Cost/
)))) as CostLC
Resident Quote
the variables looks to be empty vLocalExchangeRateCNY , vLocalExchangeRateEUR
its likely because of that.
beause script is looking for column Cost/
Hi, as @dplr-rn says and you probably guess the error is in those variables, how have you checked that the variables has any values at that point in script?
You can use 'exit script;' to stop the script at any point and check the loaded values for the variables, and also you can use the 'trace' sentence.
Also note that in script a point is used as decimal separator, maybe your expression to calculate rates are returning comma as decimal separator and causing the rates to go null() at some point before that script.
the variables looks to be empty vLocalExchangeRateCNY , vLocalExchangeRateEUR
its likely because of that.
beause script is looking for column Cost/
Hi, as @dplr-rn says and you probably guess the error is in those variables, how have you checked that the variables has any values at that point in script?
You can use 'exit script;' to stop the script at any point and check the loaded values for the variables, and also you can use the 'trace' sentence.
Also note that in script a point is used as decimal separator, maybe your expression to calculate rates are returning comma as decimal separator and causing the rates to go null() at some point before that script.