Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Linh_Nguyen
Contributor
Contributor

Error: ')' expected

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

Labels (2)
2 Solutions

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

the  variables looks to be empty vLocalExchangeRateCNY , vLocalExchangeRateEUR

its likely because of that. 

beause script is looking for column Cost/

 

 

View solution in original post

rubenmarin

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.

View solution in original post

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

the  variables looks to be empty vLocalExchangeRateCNY , vLocalExchangeRateEUR

its likely because of that. 

beause script is looking for column Cost/

 

 

rubenmarin

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.