Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple Script with SET keyword

Hi ,

can anyone tell what is the error with the following script.I am not getting the expected result..

SET currentYear=2002;

Budget:

LOAD Office,

Year,

[Budget rev.],

[Budget cost],

[Actual rev.],

[Actual cost]

FROM D:\Applns\Soumya\Qlikview\Qlikview_practices\xls-qlk\Budget.xls (biff, embedded labels, table is Sheet1$);

Budget_new:

LOAD Office,[Budget rev.],Year RESIDENT Budget where Year=$(currentYear);

Thanks in advance

1 Solution

Accepted Solutions
its_anandrjs

Hi,

See the attched sample file

Rgds

Anand

View solution in original post

7 Replies
its_anandrjs

Hi,

Your code is correct you have to drop the table after loading resident the Budget table or in place of drop table rename the new fields in resident load then you get the new year = 2002 data as output.

drop table like

Drop Table Budget;

Rgds

Anand

SunilChauhan
Champion
Champion

check this

SET currentYear=2002;

Budget:

LOAD Office,

Year,

[Budget rev.],

[Budget cost],

[Actual rev.],

[Actual cost]

FROM D:\Applns\Soumya\Qlikview\Qlikview_practices\xls-qlk\Budget.xls (biff, embedded labels, table is Sheet1$);

Budget_new:

LOAD Office,[Budget rev.],Year RESIDENT Budget where Year='$(currentYear)';

Sunil Chauhan
its_anandrjs

Hi,

See the attched sample file

Rgds

Anand

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    Let me guess whats the problem you are facing.  You are unable to find the table Budget_new.

    If yes then let me tell you the reason. The reason is the Budget_new is having the same field name as the Budget and thats the reason qlikview just appended the Budget_New in Budget.

   Please let me know if you have any other problem.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

To prevent the fields from automatically concatenating when loading, you could probably use Noconcatenate Load in the Budget_New table.

Other solutions could be to drop the budget table or to rename the fields in the Budget_new table so that they do not match the fields in the Budget table.

Regards,

GJ.

Not applicable
Author

Thank you very much anand..Got thre result..

its_anandrjs

Hi,

Thanks I am glad to help you.

Rgds

Anand