Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ext_bay
New Contributor III

Get field value from corresponding record but different value

Hi,

So I have below table for example:

AB
Tim8
John9
Mark4

In my Dashboard in Qlik Sense I have a climber selection tool in which the user has the option to select a name (only one selection is possible). So if for Example the user chooses 'Tim", I want to return '8'. How can I write the code to put this in a variable?

Thanks!

9 Replies
arulsettu
Honored Contributor III

Re: Get field value from corresponding record but different value

how do you want to show this '8'   in texbox ?

ext_bay
New Contributor III

Re: Get field value from corresponding record but different value

For example, yes. In practice I have a column that I want to multiply with the value in column B, based on the selection that is made.

omarbensalem
Esteemed Contributor

Re: Get field value from corresponding record but different value

in this column; to control the unique selection of columnA:

if(GetSelectedCount(ColA)<>1,'Please select only one ColA', sum(YourColumn) * sum(colB))

ext_bay
New Contributor III

Re: Get field value from corresponding record but different value

Thanks for you response! However, the selection is not made in column A but in another object which is similar to a list box (with only one selection), but this is not available in Qlik Sense.

omarbensalem
Esteemed Contributor

Re: Get field value from corresponding record but different value

Not a problem; with ColA, I meant the field that is in column A: let's name it fieldA:

and the expression will work

ext_bay
New Contributor III

Re: Get field value from corresponding record but different value

Ah I see, Yes that would be an option, except I am using a selection tool as  in the attachment, so the user will actually only be allowed to make one selection.

Example.PNG

omarbensalem
Esteemed Contributor

Re: Get field value from corresponding record but different value

Yes I get it, It's just to control what's shown when there is no selection for example..

Capture.PNG

Capture.PNG

the expression is :

if(GetSelectedCount(Customer)<>1,'Please select only one customer', sum(Sales) * sum(Cost))

Capture.PNG

ext_bay
New Contributor III

Re: Get field value from corresponding record but different value

This only works if I use a field option instead of a variable, but I will do for know. Thanks for you help!

darrell_tobin
Contributor

Re: Get field value from corresponding record but different value

Hi Stijn,

In this case the easiest thing is to create table in excel with values, load it into your app then you can select the fields .