Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

how to creating a vector of string with list of data in qlikview

This question is Not Answered.(Mark as assumed answered)

Jasobanta PradhanApprentice

Hi ,

I have some list of record in city field. i want to store  Bengaluru & Delhi in single variable.

 

GroundHome Away
MelbourneAway
ManchesterAway
Lord'sAway
BengaluruHome
DelhiHome

I am trying this script but it is not working.

LET Home_ground='Bengaluru;Delhi';

if(Ground='$(Home_ground)', 'Home', 'Away');

5 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: how to creating a vector of string with list of data in qlikview

if(Ground='$(Home_ground)', 'Home', 'Away');

This doesn't make any sense to me. What do you expect it to do?


talk is cheap, supply exceeds demand
Highlighted
MVP
MVP

Re: how to creating a vector of string with list of data in qlikview

If you want to go from single city to a vector-string:

DATA: LOAD * INLINE [

City,Home Away

Melbourne,Home

Manchester,Away

London,Home

Newcastle,Away

Bengaluru, Home

Delhi, Away

];


LOAD

  Concat(City,';',City) AS Cities

RESIDENT

  DATA

GROUP BY

  Ceil(RecNo()/2)  // Pair them up, two and two cities

;

 

DROP TABLE DATA;

If you want to go from vector-string to single city:

DATA: LOAD * INLINE [

Cities

Melbourne;Manchester

London;Newcastle

Bengaluru;Delhi

];


LOAD

  Ceil(RowNo()/2) AS ID,

  If(Odd(RowNo()), 'Home','Away') AS [Home Away],

  SubField(Cities,';') AS City

RESIDENT

  DATA;

 

DROP TABLE DATA;

Highlighted

Re: how to creating a vector of string with list of data in qlikview

if('$(Home_ground)' like '*'&Ground&'*', 'Home', 'Away');

Highlighted

Re: how to creating a vector of string with list of data in qlikview

one example:

QlikCommunity_Thread_299171_Pic1.JPG

LET Home_ground='Bengaluru;Delhi';

table1:

LOAD Ground,

    If('$(Home_ground)' like '*'&Ground&'*', 'Home', 'Away') as [Home Away]  

FROM [https://community.qlik.com/thread/299171] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco

Highlighted

Re: how to creating a vector of string with list of data in qlikview

Instead of storing some values in a variable, you could also use a mapping table and an ApplyMap expression to flag your home cities:

regards

Marco