Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need a variable to assign , help needed

I am new to qlikview and i need a help , I am having a column with ids for ex

ID

aa32eee

aa22rrrd

bb24rtrt

cc65sdf

I need to assign all the ids to a variable which should be like , so that i can use this variable in the script wherever i nee

'aa32eee','aa22rrrd','bb24rtrt','cc65sdf'

13 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Where you going to use the variable expression?in Load script or in charts?

Celambarasan

Not applicable
Author

In the script... i want to load some user id in a variable so that i can use the variable in any number of table to exclude the user id in that variable.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     To use in Load

     IDTable:

     Load *Inline

     [ID

     aa32eee

     aa22rrrd

     bb24rtrt

     cc65sdf];

     TempID:

     Load

          chr(39)&Concat(ID,chr(39)&','&chr(39)) as ALLID

     Resident

     IDTable:

     LET vID= FieldValue('ALLID',1);

     Drop Table TempID;

Hope it helps

Celambarasan

jemancilla
Contributor III
Contributor III


IDS:
load * inline [
ID
aa32eee
aa22rrrd
bb24rtrt
cc65sdf
]

;

SET vVariable = '';
For i=0 to NoOfRows('IDS')-1
          If len('$(vVariable)')>0 then
          Let vVariable='$(vVariable)'&Chr(44)&Peek('ID',$(i),'IDS');
          ELSE
          Let vVariable=Peek('ID',$(i),'IDS');
          END iF
NEXT i
;