Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Tags (2)
1 Solution

Accepted Solutions

Re: Simple Script with SET keyword

Hi,

See the attched sample file

Rgds

Anand

7 Replies

Re: Simple Script with SET keyword

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

Highlighted
chauhans85
Esteemed Contributor

Simple Script with SET keyword

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)';

Re: Simple Script with SET keyword

Hi,

See the attched sample file

Rgds

Anand

Simple Script with SET keyword

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

Not applicable

Re: Simple Script with SET keyword

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

Simple Script with SET keyword

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

Re: Simple Script with SET keyword

Hi,

Thanks I am glad to help you.

Rgds

Anand

Community Browser