Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Access to table data in script

Hi all!

I'm trying to read a table from a QVD file and then use a row of that table in the same script. I need it in order to read parameters and store them in variables. The sample code I'm working on is the following:

TABLA:

LOAD * INLINE [

    A,B,C

    1,2,3

    4,5,6

    7,8,9

];

LET Five=MinString({<A={4}>} B);

Is there any way to achieve this?

Thanks in advance.

1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

LET Five = Lookup('B','A', 4, 'TABLA');

Works if you are confident the lookup value is unique in the referenced column, or you can accept the first matched value.

flipside

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hi,

I'm not sure on what you want to achieve, exactly. But you cannot use set analysis in the script. However, RangeSum (and the rest of the range functions), Peek and Previous as in this thread, this thread and this other thread among many others you can search for should work.

Hope that helps.

Miguel

flipside
Partner - Specialist II
Partner - Specialist II

LET Five = Lookup('B','A', 4, 'TABLA');

Works if you are confident the lookup value is unique in the referenced column, or you can accept the first matched value.

flipside

Not applicable
Author

Thanks, Lookup solved the problem. I was trying to load a string from a qvd and then use that string to load other tables.

Btw, why does Lookup work in this situation while MinString doesn't? Just for the sake of curiosity.

flipside
Partner - Specialist II
Partner - Specialist II

There are two MinString functions, one for use in the load script and one for use in the expressions in the charts.

To use it in the script, you would need something like ...

TABLB:
     LOAD MINSTRING(B) AS Minstring resident TABLA;

   

     LET MinStr = Peek('Minstring',0,'TABLB');

flipside