Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Need a variable to assign , help needed

Hi,

     Try with this

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

Hope it helps

Celambarasan

SunilChauhan
Not applicable

Need a variable to assign , help needed

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

chandashok
Not applicable

Re: Need a variable to assign , help needed

Hi

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

Regards

Ashok

chandashok
Not applicable

Re: Need a variable to assign , help needed

Hi

          Attached Sample  file

Not applicable

Re: Need a variable to assign , help needed

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

Re: Need a variable to assign , help needed

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

chandashok
Not applicable

Re: Need a variable to assign , help needed

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
Not applicable

Need a variable to assign , help needed

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

chandashok
Not applicable

Re: Need a variable to assign , help needed

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