Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
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
Validfueltype:
LOAD
ID as v_FuelTypeID,
Name as v_FuelTypeName
FROM [lib://QlikDataQVD/MyC/MYCQVDSTORE/LSP/FuelType.qvd]
(qvd);
List:
Load
Concat(Distinct v_FuelTypeName, '|') as List
Resident Validfueltype;
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
Thank a lot! It worked!
But I also want the list to start and end with the ' character
I tried this but it didn't work (See Fueltypelist2 below):
// Valid Fuel type
Validfueltype:
LOAD
ID as v_FuelTypeID,
Name as v_FuelTypeName
FROM [lib://QlikDataQVD/MyC/MYCQVDSTORE/LSP/FuelType.qvd]
(qvd);
Fueltypelist1:
Load
Concat(Distinct v_FuelTypeName, '|') as Fueltypelist1
Resident Validfueltype;
chr(39) + Fueltypelist1 + chr(39 as Fueltypelist2;
Hi Magnus,
Please try this
Fueltypelist1:
Load
Concat(chr(39)& Distinct v_FuelTypeName&chr(39), '|') as Fueltypelist1
Resident Validfueltype;
List:
Load
Concat(Distinct chr(39)&v_FuelTypeName&chr(39), '|') as List
Resident Validfueltype;
This will give you 'value1'|'value2' etc etc.
I assume this for a variable input that you want to use in the front end... If so, there is a "better" way. Let me know
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
Hi Jandre,
Thanks for your help. Yes it for use in the front end. I want the list to be:
'value1|value2|value3' etc.
Best regards
// Magnus
Exactly what I thought. Hahah
For the back end you can do it like this
Load
Chr(39)& Concat(Distinct v_FuelTypeName, '|')&chr(39) as List
Resident Validfueltype;
But on the front end you can create another variable or just in the dynamic fx box of where you would put the List field (created above) enter this
={1} Chr(39)& Concat(Distinct v_FuelTypeName, '|')&chr(39)
It would be the same result and you dont need to perform a reload.
Let me know
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
It seems that the list should be OK now but the list doesn't show up in the front end...:
What am I doing wrong in the front end?
Thanks again
// Magnus
Just use it like this
=Fueltypelist1
That should work.
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
Sorry but =Fueltypelist1 it shows:
But if I Use this direct in frontend unde f(x) it works! 🙂
={1} Concat(Distinct v_FuelTypeName, '|')
Best regards
// Magnus
But if I