Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Assign variable from previous qvd in script

Hi colleagues this might be easier than I thought but I am stuck and need guidance.

I have a list of clients stored in a qvd (clients.qvd) which I then join to a SQL query in my script. This list may suffer changes like new or deleted clients.

Considering those possible changes I have been trying to assign the client id to a variable to then use it in the SQL query without having to join, by doign this the sql query becomes more efficient..

When running the Debugger I see the qvd is pulled correclty with data however the variable does not obtain the ClientId value/s:

Script:

Clients:

LOAD distinct ClientId

FROM [..\QVD\ClientsList.qvd] (qvd);

LET vCCode = Concat(CLientId,',');

Debugger output:

vCCode     <NULL>

ClientId     <NULL>

I am sure I am overlooking something here, any help will be greatly appreciated, thanks!

Tags (2)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Assign variable from previous qvd in script

Hi

Clients:

LOAD distinct ClientId

FROM [..\QVD\ClientsList.qvd] (qvd);

ClientList:

LOAD Concat(ClientId, ',') As ClientList

Resident Clients;

LET vCCode = Peek('ClientList');

DROP Table ClientList;

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
Highlighted
MVP
MVP

Re: Assign variable from previous qvd in script

Hi

Clients:

LOAD distinct ClientId

FROM [..\QVD\ClientsList.qvd] (qvd);

ClientList:

LOAD Concat(ClientId, ',') As ClientList

Resident Clients;

LET vCCode = Peek('ClientList');

DROP Table ClientList;

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

Highlighted
Contributor III
Contributor III

Re: Assign variable from previous qvd in script

Thank you Jonathan!