Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to load from ODBC if a condition from another qvd is met?

I have a qvd with reserving lines that is referenced at the beginning of the script. However after loading all of the mappings, I would only like the ODBC connect statement to be executed if only one of the reserving lines is selected (i.e only proceed with ODBC connect if casualty is selected, skip the process if not). Can anyone help me figure out the structure?

1 Reply
Highlighted
Partner
Partner

Hi Santiago,

Since you haven't provided much information on how your data is organized, I made a simple example that can achieve what you want.

Sample:

LOAD * Inline

[

ID,Reserved,ConnectionString

1,N,XYZ

2,N,ABC

3,Y,DEF

];

NoConcatenate

ConnectODBC:

Load

*

Resident Sample

Where Reserved = 'Y';

drop table Sample;

if (NoOfRows('ConnectODBC') = 1) then

trace Only 1 Row selected.;

let vConnectString = peek('ConnectionString',0,'ConnectODBC');

trace Connection String: $(vConnectString);

else

trace(Multiple Rows selected, no connection made!!!);

End if;

The above code can get the connection string only if one condition is met.

Felipe.