Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select the same field value when selected in another field

Hi community,
I have two fields in two list boxes.  One is a regular field while the other is an expression that yeilds values that are the same as the regular field.
Regular List box: GL_Account_Number_Name_Balance_Sheet3
Expression List box: =if(match(QB22,el2),GL_Account_Number_Name_Balance_Sheet3)
Is there a way that clicking either one will select the other?  Right now a selection in one of the boxes only exlcudes the values that aren't it in the other list box.
1 Solution

Accepted Solutions
Not applicable
Author

For now I just did an if matching type calculated expression looking at the actual field values and not matching other fields)  This works but is a pain in the number of copies and pastes.

View solution in original post

9 Replies
swuehl
MVP
MVP

Brandon,

I solved this in one of my settings (QV11) using:

=aggr( only({1} if(Value>$(vVal),Product)), Product)

so you might try:

=aggr( only({1} if(match(QB22,el2),GL_Account_Number_Name_Balance_Sheet3)), GL_Account_Number_Name_Balance_Sheet3)

Hope this helps,

Stefan

Not applicable
Author

Hi swuehl,  that might work bu QV desktop locks up when I try it for some reason?

swuehl
MVP
MVP

Hi Brandon,

it should not lock your system. What version are you using?

QB22 and el2 are fields in your data model, right? Are they located in the same table as GL_Account_Number_Balance_Sheet3?

Is it possible that you create a small sample app that you can upload here?

edit: attached is a sample that works at my place

Not applicable
Author

Here is a copy of the document

swuehl
MVP
MVP

Brandon,

I am confused.

What is e12?

I see it in your expression, but can't see it in your field list or variable list.

If I use a list box with manually entered e12, it says invalid field, if I copy & paste it from your list box expression, it results in some numbers.

I noticed that you read in a similar named fied in your last load but aliased it.

Coming back to your problem, would it be possible that you create a field in your script instead of using that expression? Using fields, there are some methods to copy field values from one list box to another representing another field, but with same values.

edit: Some methods are discussed here: http://community.qlik.com/thread/35764

Not applicable
Author

el2 not e12, i see that el2 is available as a field when i look at the document.

Basically, I want the same field minus a bunch of values in the other list box.

I have the same list box and field in it on different tabs.  I want to load only the field values that are selectable on the tab, that is why I have the calculated expression for the one.  If there is another or better way, I am open to it.

Not applicable
Author

For now I just did an if matching type calculated expression looking at the actual field values and not matching other fields)  This works but is a pain in the number of copies and pastes.

swuehl
MVP
MVP

me> What is e12?

Ah, I was confused by different fonts, quite a stupid mistake.

you>For now I just did an if matching type calculated expression looking at the actual field values and not matching other fields)  This works but is a pain in the number of copies and pastes.

Could you post this line of code? Would like to see your solution.

I managed to get my original idea working with your data by joining the QB22 field to the BalanceLinking4 table.

Not sure if this is appropriate for you.

Regards,

Stefan

Not applicable
Author

Like I said not pretty, but it works and it really isn't any different in terms of breaking points.  If I needed to include another field value to be included in this list box, before I would have had to added it to QB22 in the script.  Now I just add it to the match part of the expression.

=if(match(GL_Account_Number_Name_Balance_Sheet3,'17010-MATERIALS-WORK IN PROCESS','17020-DIRECT LABOR-WIP','17030-DIRECT LABOR-WIP-LEASED','17250-OVERHEAD-WIP-MACHINE','44010-COMMON STOCK AUTHORIZED','44020-COMMON STOCK UNISSUED','
44030-STOCK UNITS','44050-TREASURY STOCK'),
GL_Account_Number_Name_Balance_Sheet3)

Your joining method works too and I'll make sure to employee that in the future.  I don't really come from an SQL background and try to do a lot in the document when there are easier ways.  Thanks Swuehl!