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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get specific data from a Table

Dear All,

I´m with a doubt of how to get a specific data from a table.

I have a table like it:

     Field 1          |            Field 2          |          Field 3

     Brasil                   Rio de Janeiro                 1

     Argentina            Buenos Aires                   2   

     Mexico                 Mexico City                        3

I wrote a statement in a text box like bellow and I´m not geting the expected result ( " 1 " ), I´m getting a "-" character.

=IF([Field 1]='Brasil'

          and [tField 2]='Rio de Janeiro', [Field 3])

If I select in a pivot table Brasil, it works.

Best Regards,

André

1 Solution

Accepted Solutions
Not applicable
Author

If I understand it correctly, text object should always displays value for Field 3, where Field 1=Brasil and Field 2=Rio de Janeiro. Text object in attachment is set this way, with assumptition that there is only one record in the data model table with values Field 1=Brasil and Field 2=Rio de Janeiro.

regards

View solution in original post

8 Replies
Not applicable
Author

Initial guess is that you have spaces that you are not accounting for in your if statement.

try this

IF( trim([Field 1])='Brasil'

          and trim([Field 2])='Rio de Janeiro', [Field 3])

not sure if 't' in field 2 was a mistype or not.  if not that could be your problem.

Anonymous
Not applicable
Author

Klangley,

It did not work. The problem is not the word comparision. The problem is to select an specific data in a table.

Thanks the help.

Best Regards,

Not applicable
Author

Hi,

for that purpose you can use set analysis. Set this expression as text in text object:

=Only({$<[Field 1] ={"Brasil"}, [Field 2] ={"Rio de Janeiro"}>} [Field 3])

regards

Anonymous
Not applicable
Author

Krunoslav,

Thanks the help but it did not worked. Same problem.

Rgds

Not applicable
Author

Can you attach qv file that you are working on?

Anonymous
Not applicable
Author

See attached a qvw with the problem. See that if you select Brasil in the tabel the Field 3 appears in the text box.

Thanks in advance,

Rgds,

Not applicable
Author

If I understand it correctly, text object should always displays value for Field 3, where Field 1=Brasil and Field 2=Rio de Janeiro. Text object in attachment is set this way, with assumptition that there is only one record in the data model table with values Field 1=Brasil and Field 2=Rio de Janeiro.

regards

Anonymous
Not applicable
Author

Krunoslav,

Yes, this is the point !!! Thanks.

Regards,

André