Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sgg_gaikwad
Partner - Contributor II
Partner - Contributor II

Inculde function with If statement is it Possible ...?

This script is not working......

Config:

LOAD

ScriptConfig

FROM Configurations.xls

(biff, embedded labels, table is ObjectConfig$);

let VRow = NoOfRows('Config');

let VInclude = FieldValue('ScriptConfig',$(VRow));

if $(VInclude) then

$(Include= File1.qvs)

ELSE

$(Include= File2.qvs)

EXIT Script;

end if

12 Replies
sgg_gaikwad
Partner - Contributor II
Partner - Contributor II
Author

Hi Massimo,

      Could you please try on this Application it's not yet working For Else condition...?

Means if i pass File2.qvs in .Xls it should go for Else part but not getting as expected..?

Regards,

Swapnil

Not applicable

Hi Swapnil,

If you are passing the value of the file name already in the config file, then you do not need the if condition right.

Just use the value directly from the config file.

Config:

LOAD ScriptConfig

FROM

Configurations.xls

(biff, embedded labels, table is ObjectConfig$);

let VRow = NoOfRows('Config');

let VInclude = FieldValue('ScriptConfig',$(VRow));

trace>> Reading  $(VInclude);

$(Include=$(VInclude))

maxgro has given on your requirement to check if there's a value or not in config file.

maxgro
MVP
MVP

if len(trim('$(VInclude)'))>0 then

$(Include=$(VInclude));

//  trace include file1;

// 

//  $(Include=File1.qvs);

// 

//ELSE

//  trace include file2;

// 

//  $(Include=File2.qvs);

// 

//  EXIT Script;

end if;