Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Variable to condition file table selection

Hi All,

I have an application that needs to condition which table(s) to load based on the content of a control table.

I loaded the control table and set a variable true/false.

If the variable is true, TABLEA is loaded.

If the variable is false, TABLEB is loaded and TABLEC is left joined to TABLEB.

The syntax escapes me. Can someone please point me in the right direction?

Thanks,

Rich

2 Replies
Not applicable

Variable to condition file table selection

numeric value of True is -1, False is 0. You may check for these in an IF and LOAD A or B.

Not applicable

Variable to condition file table selection

Thanks, for your reply Jasleen,

I found the syntax I was looking for;

IF '$(vEPDM)' = 1 then
Item:
Load  ITNBR;
SQL Select ITNBR
FROM S10AE37C.AMFLIB7.ITEMASA;

Elseif '$(vEPDM)' = 0 then
Item:
TEMPB:
Load ITNBR;
SQL Select ITNBR
FROM S10AE37C.AMFLIB7.ITMRVA;

Endif