Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
MVP & Luminary
MVP & Luminary

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
MVP
MVP

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;

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

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

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