Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
MagnusRydberg1
Partner - Contributor III
Partner - Contributor III

Create a list from a Table

Jag have a table(FuelType) med with different fuel types,  I want to create a list (Fueltypelist) with the different fuel types seperated with '|'.

 

Have tried this but it doesn't work

Validfueltype:

LOAD

    ID as v_FuelTypeID,

    Name as v_FuelTypeName

    FROM [lib://QlikDataQVD/MyC/MYCQVDSTORE/LSP/FuelType.qvd]

   (qvd);

 

Let LoopNumber=1;

For LoopNumber= 1 to NoofRows('Validfueltype')

LET Fueltypelist=Peek('v_FuelTypeName', LoopNumber-1,Validfueltype)+ '|'+Fueltypelist;

Next;

 

Labels (3)
12 Replies
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @MagnusRydberg1 

If the Fueltypelist1 values are 'value|val2|val3' etc in the data model it should work... Maybe try =$(Fueltypelist1) 

I generally do this in the front end. So if you need the back end solution and the top one doesn't work I can check this out for you later. Alternatively just use the front end one? 😉 

Regards Jandre 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

MagnusRydberg1
Partner - Contributor III
Partner - Contributor III
Author

It's OK I'll use the front end solultion!

But I'm curious why the other way doesn't work. I've tried $(Fueltypelist1) but it didn't work..

Anyway Thanks again for all help! 🙂

// Magnus

 

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @MagnusRydberg1 

If the expression in the back end is 

Chr(39) & Concat(Distinct Fueltype, '|') & Chr(39) as List

Then just doing a =List should work... 

Im replying on my mobile so not close to a laptop now to test this. Alternatively you can do 

Concat(Distinct Fueltype, '|') as List and in the front end do 

='$(=List)' 

Regards Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn