Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nikhil2725
Creator II
Creator II

Using Array

Hi All,

I want to use the Array in Qlik sense...

Kindly Look for below example..

LOAD * INLINE

[ Client_ID,IS_active, Client_name,Address

234, 0,ABC,New York

235,0,DEF,Canada

236,1,XYZ,India

237, 1,MNO,Australia

238, 1,PQR,Italy

];

Here IS_active is field where it will check whether that particular client is active in our DB or not and if the IS_active=1 then the particular Client_ID is active.

Here in the above example, Client_ID 236,237 and 238 is the active Clients.

And Also I want to retrieve the data using Array for only the clients which is active.

Kindly help me in this.

7 Replies
pradosh_thakur
Master II
Master II

Use in a text object or variable
concat(distinct{<IS_active={1}>} Client_ID,',')
Learning never stops.
Nikhil2725
Creator II
Creator II
Author

Hi, Pradosh_thakur,
Thanks for the reply.
I want to compare some values form a table and if they meet certain criteria, I want to retrieve this values.
I will use it in an iterative process, so I am looking for something, where I can retrieve values repeatedly.
And after creating such an array, how can I retrieve the values.
Regards,
Nikhil
pradosh_thakur
Master II
Master II

Not sure what you mean by creating an array here. Can you please tell us the sample out put from the sample data?
Learning never stops.
Nikhil2725
Creator II
Creator II
Author

It means like, I have to create an array and store the values of Client ID in that particular array.
Then I will use iterative method for the array to display only the data where the IS_active will be 1.
in the above example which I have given.
I want only the values of client which are active.
i.e. output will display as below:
Client_ID, IS_active,Address
236,XYZ,India
237,MNO,Australia
238,PQR,Italy
pradosh_thakur
Master II
Master II

Well!! You dont need to cretae an arraya nd iterate through it .
concat(distinct{<IS_active={1}>} Client_ID,',') will give the output where is_Active is 1
Learning never stops.
Nikhil2725
Creator II
Creator II
Author

Can u please explain with the sample code for the above example?
pradosh_thakur
Master II
Master II

It will list out all the client_ID separated by comma where Is_active flag is 1 i.e. the client id which are active. You can replace the client_id with client name and it will list the client names as well.
Learning never stops.