Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error in expression: ')' expected and Table not found

Hello,

I get this error while trying to run this script. it says:

Error in expression: ')' expected and Table 'TEMP_FACT' not found

What am i doing wrong? Thanks

TEMP_FACT:

LOAD

     AssetModelKey,

     AssetStatusKey

     FLAG, ....etc

FROM

$(vQVD)Fact1.qvd

(qvd);

FACT:

Load *,

IF((FLAG='INV' AND Match(AssetStatusKey,'2','4')), RangeSum(Count(AssetModelKey),Peek('AccumulateInventory')), Count(AssetModelKey)) as AccumulateInventory,

IF((FLAG='INV' AND Match(AssetStatusKey,'3','5')), RangeSum(Count(AssetModelKey),Peek('AccumulateSold')), Count(AssetModelKey)) as AccumulateSold

Resident TEMP_FACT;

DROP TABLE TEMP_FACT

5 Replies
swuehl
MVP
MVP

Your TEMP_FACT table may need a comma separating your field name AssetStatusKey from FLAG.


Your FACT table is using aggregation functions like Count() without a GROUP BY clause, which will not work.

Anonymous
Not applicable
Author

I added Group By, but it still give me the same error:

TEMP_FACT:

LOAD

     AssetModelKey,

     AssetStatusKey,

     FLAG,

     AgrmntNo

....etc

FROM

$(vQVD)Fact1.qvd

(qvd);

FACT:

Load *,

IF((FLAG='INV' AND Match(AssetStatusKey,'2','4')), RangeSum(Count(AssetModelKey),Peek('AccumulateInventory')), Count(AssetModelKey)) as AccumulateInventory,

IF((FLAG='INV' AND Match(AssetStatusKey,'3','5')), RangeSum(Count(AssetModelKey),Peek('AccumulateSold')), Count(AssetModelKey)) as AccumulateSold

Resident TEMP_FACT

Group By AgrmntNo;

DROP TABLE TEMP_FACT

swuehl
MVP
MVP

Is this really one single error message or do you see several errors popping up one after the other?

If you add an exit script statement  before the FACT table load, does it  execute without error?

Your GROUP BY needs to list all fields that are not used within aggregation functions, hence since you are using a star symbol in your FACT table load, you at least are missing FLAG, AssetModelKey, AssetStatusKey, AgrmntNo fields in your group by.

Anonymous
Not applicable
Author

it is actually several errors popping after another.

if i add exit script it still gives the error ') is expected'

swuehl
MVP
MVP

Then maybe start with posting your full LOAD statement for TEMP_FACT table and also double check the variable vQVD.

edit: And please post full error message (e.g. using a screen shot).

The issue may even arise from a statement that appears before the TEMP_FACT table LOAD.