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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get value into variable based on condition

I have table as below-

    Tab2:

ID, Description
1, India
2, China
3, USA
4, NY
5, NJ
6, SA

In my variable I want to move particular value.

E.g.

Variable1 = Description where ID = 5.

Variable1 will have value of 'NJ'.

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Try with this definition

=only({<ID={5}>}Description)

Regards

ASHFAQ

View solution in original post

5 Replies
Not applicable
Author

Can any body help on this?

ashfaq_haseeb
Champion III
Champion III

Try with this definition

=only({<ID={5}>}Description)

Regards

ASHFAQ

alex_millan
Creator III
Creator III

Don't know how to do it in the script but,

Would it be suitable to pass the value after scripting just defining in the variable overview panel?

To define it, would be like this:

=Only({$<ID = {"4"}>} Description)

Hope it helps. Find attached an example.

Regards,

Not applicable
Author

Hi Ashfaq,

Thanks for reply.

Not applicable
Author

Thanks Alex.