Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Storing dat in Array

Hi All,

I have table called HolidayTable. It has three fields DC, Dates, Holiday Flag.

If I select One particular DC and Flag = Y. Then It is showing three days. That means that DC have three holidays. I want to store those dates in Array format.

How is it possible?

Thanks,

Sarif

5 Replies
MK_QSL
MVP
MVP

Use Concat function to store them in a Variable

mhmmd_srf
Creator II
Creator II
Author

Yes It is working...but when I am trying to apply pick function on that. pick is not working.

Do we need to change format? Is pick works only in string?

Please suggest.

Thanks,

Sarif

MK_QSL
MVP
MVP

First of all, we are unsure what exactly you want to get !

Can you please provide your current script and also describe what you want to have end result..

marcus_sommer

You need to include quotes within your valuelist, maybe in this way:

...

chr(39) & concat(Dates, chr(39) & ',' & chr(39)) & chr(39) as ValueList

...

- Marcus

petter
Partner - Champion III
Partner - Champion III

There are at least two ways of picking values out of such a string:

SubField( vMultiDates , ',' , 1)    

Using Pick you have to have a more complicated Concat() to include single quotes which is Chr(39):

vMultiDates = Chr(39) & Concat( DC , Chr(39) & ',' & Chr(39) , DC) & Chr(39);

// Will give you a string like this:  '11/08/2016','12/14/2016','12/30/2016'    notice that it contains single quotes

Pick( 2 , '$(vMultiDates)'

     , <expression-for-the-first-date>

     , <expression-for-the-second-date>

     , <expression-for-the-third-date>

)