Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing ListBox selections to another (different) ListBox

Hi all,

   Let us suppose I have two different tables with the same content under different names (not linked to each other, and cannot be linked due to circular references), like:

  • Table A
    • Cod1
    • Desc1

  • Table B
    • Cod2
    • Desc2

   Now let us suppose I only have a ListBox for Table A, and I can only select Desc1. The question here is, is it possible when one selects something in Desc1 it will automatically select under Desc2 (a full name match is present).

   Sorry if this is somewhere available in documentation, but honestly I cannot find it.

Thanks

20 Replies
swuehl
MVP
MVP

Ok, misunderstood you previous post then.

I've attached a sample with sum() and p()-function like above, seems to work to me.

Regards,

Stefan

Not applicable
Author

Hi Stefan,

   It's exactly this!

Thanks,

André

Not applicable
Author

Just one last question, if the contents of Desc1 doesn't have an 100% match with Desc2, is there any way of accomplishing the desired effect?

Regards,

André

swuehl
MVP
MVP

André,

is there any rule concerning the differences between field values?

Not applicable
Author

Not really, the difference is because Desc2 table was built by joining several other tables, and the impossible combinations (for the intended purpose) are left out Desc2.

The problem is that I can only make few changes on the data model, or else I would change the inner joins to several left joins (this would be easier I presume) and like this Desc1 and Desc2 would be a perfect match, that's why I posted this extra question.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Stefan,

Works great! (I copy/pasted your prior example and didn't notice the misspelling of the field names).

Nice technique. I'll include in the next edition of the cookbook if you don't mind.

-Rob

http://robwunderlich.com

swuehl
MVP
MVP

Rob,

sure I don't mind. BTW, I am fan of your compilation, great work!

If you are about to compile some samples of how to set states in list boxes, I think this might be also a nice example of using the set expression method

(and maybe an example for a problem where I think the method using concat / GetFieldSelections etc. reaches its limit anyway):

http://community.qlik.com/message/151017

Regards,

Stefan

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Hi Stefan,

i have looked at this example of passing List box values from one to another. looks good.

i want one more additional feature as stated below.

i wants to acheive the 2nd point.

1.) if i select "aa" in Desc 1 then in Desc 2 list box  same needs to be selected. (This functionality is already there)


2.) next if i clear all from or if i unselect "aa" from Desc 1 list box, then same thing should happen in Desc 2 list box too.
so it has to clear the Desc 2 listbox, if nothing was selected in Desc 1 listbox.

i have added again the exapmle of yours.

Thanks,

phani

swuehl
MVP
MVP

Hi Phani221984,

the application as is should fulfill both of your requirements. I just checked on a machine with QV 10 SR2, it works.

Hm, checking more: On a version9 something (probably no SR, aaargh) I needed to remove the square brackets from the field name, i.e. just

Desc 2

instead of [Desc 2]

to make it work, but then also the clearing worked.

What version do you use?

Stefan

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Thanks Stefan,

you are right. Mine is QV10 SR1.

i have upgraded to QV10 SR3 and it is working fine.

Just to let you know it dint worked even after removeing the "Square brackets" from Desc 2.

That might be because of the Version10 SR1

Thanks

Phani