Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Setting load script variable to previously loaded value

Is it possible to set a variable to the value of a field that has been previously loaded in the load script? I'm trying to use a database to drive the configuration of various application settings. I have a table that will always contain one row of configuration data when loaded into QlikView - that table would store the configuration data I'm trying to use in variables. The table structure looks something like this:

ProjectID ConfigSetting1

X Foo

Y Bar

First I load my table into QlikView:

ConfigTable:
SQL
SELECT *
FROM ConfigTable
WHERE ProjectID = 'X';


I then want to use the value of ConfigSetting1 to set a variable:

SET vConfigSetting1 = ConfigSetting1;


That syntax doesn't work, so I tried a bunch of variations with SET, LET and dollar-sign expansion, all to no avail. My ultimate goal is to use this variable when building a string so I can conditionally pull in a project-specific include file later in the load script. For example:

TableWithProjectSpecificLoadLogic:
$(Include=$(vEnvironment)\Includes\ThisIncludeFile_$(vConfigSetting1).txt);


Any help is appreciated.

Thanks,

Jim

Tags (3)
1 Solution

Accepted Solutions

Setting load script variable to previously loaded value

LET vConfigSetting1 = peek('ConfigSetting1');

-Rob

3 Replies

Setting load script variable to previously loaded value

LET vConfigSetting1 = peek('ConfigSetting1');

-Rob

Not applicable

Setting load script variable to previously loaded value

Well that was painfully simple. Tongue Tied

Thanks, Rob.

flores
New Contributor

Setting load script variable to previously loaded value

I have a similar question; but not...

I read a table

weekly_times:

Load week1

from weekly_times;

let current_week=peek(week1); /* value is set to WK1010'

now I want to use current_week in various ways - all fail.

load $(current_week) as weektoload

resident weekly_times;

fails with file not found and brings the following message

load WK1010 as weektoload....

it is not using the TEXT WK1010 it seems like it's using the WK1010 as a column name.

I realy want to load 'WK1010' into the table.

any ideas?

Amarilis.

Community Browser