Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Setting variable in the load from a table

Hi,

So I have a simple table that I use to determine whether or not I want to load data from certain regions, its called Active regions.

The structure is something like this

RegionOperational
North1
South0
East0
West1

I want to create a variable called vLOAD if the region is North and Operational is 1. I then want to use that vLOAD variable to say, if vLOAD =1 then load another table, if not then move down the script.

Is this type of thing possible?

Thanks

Stuart

1 Solution

Accepted Solutions
MVP
MVP

Re: Setting variable in the load from a table

You can also access directly your original table:

Table:

LOAD

  Region,

     Operational

FROM

[https://community.qlik.com/thread/221010]

(html, codepage is 1252, embedded labels, table is @1);

Let vLOAD = Lookup('Operational','Region','North','Table');

If vLOAD = 1 THEN .....

3 Replies

Re: Setting variable in the load from a table

May be like this:

Table:

LOAD Concat(Operational, ', ', Key) as List;

LOAD RecNo() as Key,

  Region,

     Operational

FROM

[https://community.qlik.com/thread/221010]

(html, codepage is 1252, embedded labels, table is @1);

LET vNorth = SubField(Peek('List'), ', ', 1);

LET vSouth = SubField(Peek('List'), ', ', 2);

LET vEast = SubField(Peek('List'), ', ', 3);

LET vWest = SubField(Peek('List'), ', ', 4);

MVP
MVP

Re: Setting variable in the load from a table

You can also access directly your original table:

Table:

LOAD

  Region,

     Operational

FROM

[https://community.qlik.com/thread/221010]

(html, codepage is 1252, embedded labels, table is @1);

Let vLOAD = Lookup('Operational','Region','North','Table');

If vLOAD = 1 THEN .....

Not applicable

Re: Setting variable in the load from a table

Thank you. I know these thangs are failrly simple but you are a guru !

Community Browser