Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
avinashkk696
Contributor III
Contributor III

Convert the Dimension values into an array and store in a variable

Hello All,

I am completely new to Qliksense. I have a requirement where I have to java script in which I have to display all the dimension values as an array. For example, I have a dimension Country. I have to display all the values in the dimension as a coma separated value in the console.

I have searched for all the Qliksense APIs and could not find any to implement the same.

Hope you will hepl me on this

Thanks in advance

4 Replies
MarioCenteno
Creator III
Creator III

Try

[dimension_name]:

load * inline [

dimension

   country

];

Mario Centeno

petter
Partner - Champion III
Partner - Champion III

To get all the values of the field Country as a comma-separated list in a string you can use the Concat() function.

=Concat(DISTINCT Country,',')         will give           Albania,Belgium,Canada

if the Country field contains the three values ...

The DISTINCT keyword is not neccessary if the field only contains distinctive values.

avinashkk696
Contributor III
Contributor III
Author

Thank you for your response.

I need to convert a dimension values into an array of string in JAVA SCRIPT. I am creating an extension in qliksense for which I should show the values of the dimensions in a string separated by a com.

I should not do that at the script level.

pablolabbe
Luminary Alumni
Luminary Alumni

Better put your question here Qlik Sense - Integration, Extensions and APIs


When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.