Skip to main content
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,

     Try with this

     vVariable= chr(39)&Concat(ID,chr(39)&','&chr(39));

Hope it helps

Celambarasan

SunilChauhan
Champion
Champion

control +alt +v

add -> varable name

vID=Concat(ID,',')

use

=$(vID) to text or any where your want

or

directely

=

vID=Concat(ID,',')


hope this helps

Sunil Chauhan
Anonymous
Not applicable
Author

Hi

          Hope the attached file will be clarified your doubt and help to get solution for your problem

Regards

Ashok

Anonymous
Not applicable
Author

Hi

          Attached Sample  file

Not applicable
Author

In the attached sample, the month jan and feb are hardcoded... But how you can get the month field name alone so that it will display 'jan',feb','mar'

Not applicable
Author

When i try your code i am getting a eroor while loading the script

  LET vVariable= chr(39)&Concat(OPRID,chr(39)&','&chr(39))

    Error: Aggregation expressions not allowed in GROUP BY clause

Anonymous
Not applicable
Author

Hi

     Hope this will be helpful for your problem

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

     use this in your script load

     refer the sample attached qv file

Regards

SunilChauhan
Champion
Champion

use below code 

set vcon=concat(Month,',');

Data:

LOAD * INLINE [

    Product, Year, Month,Sales

    A, 2011, Jan, 1000

    A, 2012, Feb, 2000

    A, 2013, Mar, 3000   

];

and use in text box

$(vcon)

hope this helps

Sunil Chauhan
Anonymous
Not applicable
Author

Hi

In Loding Script , use this

           set vVar = Concat(chr(39)&Month&chr(39), ',');

         

Data:

LOAD * INLINE [

    Product, Year, Month,Sales

    A, 2011, Jan, 1000

    A, 2012, Feb, 2000

    A, 2013, Mar, 3000   

];

and use in text box

$(vVar)

it will return the answer like this

'Feb','Jan','Mar',  

for that variable

Regards

Ashok