Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sivaboggarapu20
Partner - Creator
Partner - Creator

The following error occurred: Unexpected token: '=', expected one of: '

Hi Team,

I am running the below script. But, I am getting below error. Could some one help me on the below error code?

AWSDetaiQVD:

LOAD

    InvoiceID,

    PayerAccountId,

    LinkedAccountId,

    LinkedAccountName,

    ProductCode,

    RecordType,

    RecordId,

    ProductName,

    RateId,

    UsageType,

    Operation,

    AvailabilityZone,

    ItemDescription,

    UsageStartDate,

    UsageEndDate,

    UsageQuantity,

    BlendedRate,

    BlendedCost

FROM [lib://QVD/AWSDetail.qvd](qvd)

where Exists(InvoiceID);

Let vExists=Peek(InvoiceID,$(vNoRows)+1,'Billing');

Let vExistsLen=Len(trim(Peek(InvoiceID,$(vNoRows)+1,'Billing')));

if $(vExists)=NULL() or  $(vExistsLen)<0 THEN

drop table Billing;

The following error occurred:

Unexpected token: '=', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...

---

The error occurred here:

if >>>>>>=<<<<<<NULL() or 0<0 THEN


1 Solution

Accepted Solutions
christophebrault
Specialist
Specialist

Hi,

Try :

if vExists=NULL() or  $(vExistsLen)<0 THEN

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin

View solution in original post

6 Replies
christophebrault
Specialist
Specialist

Hi,

Try :

if vExists=NULL() or  $(vExistsLen)<0 THEN

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
sivaboggarapu20
Partner - Creator
Partner - Creator
Author

Hi Brault,

Its working fine but I I would like to know what is the issue with above code?

Please explain me

Thanks,

Siva

christophebrault
Specialist
Specialist

I just figure out that you have to write vExistsLen as well after the or.

I can't technically explain you the "why". But from my experience, variables outside LOAD statement or functions should be used without the $()

hic‌ could have an explanation ?

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
sivaboggarapu20
Partner - Creator
Partner - Creator
Author

Thank you Brault

Sheenu
Contributor II
Contributor II

I am hitting same error.

Let vOrder = peek('Order',0,'loadTable');
Trace 'vOrder is ' $(vOrder);

If Not IsNull($(vOrder)) then

   someLogicHere;

end if;

 

Getting error as below, I know, vOrder will be null at this stage, but code not going through.

Unexpected token: 'IsNull', expected one of: '(', 'IsNum', 'Irr', 'Kurtosis', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', ...
The error occurred here:
If Not >>>>>>IsNull<<<<<<() then
Sheenu
Contributor II
Contributor II

Sorry, please ignore. Missed putting the solution provided. Did the same as suggested & it worked.