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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show only group of values

Hi,

I tried unsuccessfully to look for the answer in the forum.

I'm trying to create a TalbeBox which may show my the values in my field (CityName) that belongs only to Europe.

I don't have a list of cities in Europe so I have to create one (without changing or creating tables).

I tried to set a group of values in the script this way:

SET Europe='London;Amsterdam;Moscow';

(these are the only 3 cities in my DataBase that belong to this group).

Is that correct?

And now, how can I create a table box that will show only the field CityName in which the value is from that created group?

Thanks!

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Hmmm I am not sure how it can be done in Table box. Sorry.

Alternative will be using Sunny's magic trick of using Dim table.

But using the below code we can do this using straight table like:

LOAD * INLINE [

Name

Europe

];

SET vCity = 'London,Amsterdam,Moscow';

LOAD * INLINE [

Dim

1

2

3

];

Use Straight table with

Dimension: Name, Dim

Expession: = Pick(Dim, Subfield('$(vCity)',',',1), Subfield('$(vCity)',',',2), Subfield('$(vCity)',',',3))

Hide the dimension table.

Capture.PNG

In the presentation tab select the Dim column and hide column check.DimHide.PNG

View solution in original post

8 Replies
vishsaggi
Champion III
Champion III

What is your expected output should be? You want in your tablebox to display like

Field1   City

Europe London

Europe Amsterdam

Europe Moscow

Is this what you are looking for?

Not applicable
Author

If it is possible i'd like to display it this way:

CitiesInEurope

Moscow

London

Amsterdam

If it is not possible, your way is fine too.

BUT i'd like to make a list of these cities so I can use the list to make this table.

Thanks

vishsaggi
Champion III
Champion III

Hmmm I am not sure how it can be done in Table box. Sorry.

Alternative will be using Sunny's magic trick of using Dim table.

But using the below code we can do this using straight table like:

LOAD * INLINE [

Name

Europe

];

SET vCity = 'London,Amsterdam,Moscow';

LOAD * INLINE [

Dim

1

2

3

];

Use Straight table with

Dimension: Name, Dim

Expession: = Pick(Dim, Subfield('$(vCity)',',',1), Subfield('$(vCity)',',',2), Subfield('$(vCity)',',',3))

Hide the dimension table.

Capture.PNG

In the presentation tab select the Dim column and hide column check.DimHide.PNG

Not applicable
Author

Thank you for helping!

This is what I get when I do so:

‏‏לכידה.PNG

which means that for each city in my databse it shown all the cities in Europe.

Not applicable
Author

Ok it worked!

Thank you so much.

How can I make the empty line gone?‏‏לכידה2.PNG

vishsaggi
Champion III
Champion III

Ok based on your plantName what is your expected output should be for the City field ?

vishsaggi
Champion III
Champion III

Just check No Totals for your expression Plant Name. What table object are you using?

Capture.PNG

Not applicable
Author

Straight table.

It worked again, thanks!!