Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Equal values in two listboxes

Hi Everyone,

Can someone direct me towards a formula I can utilize to find the common values between two different list boxes. This is the formula I am currently using

=if(d2.month=12 and d2.month=11 and match(d1cust.clientid,d1cust.clientid) but it gives me an error. My data has formed some sort of a array and select all doesn't seem to work.

Thanks in advance.

8 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you post a screenshot of your data model?

Qrishna
Master
Master

post some sample data.

Not applicable
Author

Hi Guys,

How can I post the data on Qlik Community? I would have to send you the QVDs and the scripting and the joins I have made between the tables in order for you to accurately analyze the data. I just need a formula which I can useCapture.PNG in another list box which would give me the IDs which are common in both of the list boxes. What do you suggest?

Thanks,

Qrishna
Master
Master

Try this in a  new list box:

if(ListBox1Field = ListBox2Field,ListBox1Field )

ListBox1Field =  [Nov - 101151]

ListBox2Field = [Dec - 107673]

sebastiandperei
Specialist
Specialist

Hi. Try:

aggr(only({<Field1=P(Field2)>}Field1),Field1)

PradeepReddy
Specialist II
Specialist II

if your intention is to compare the content of 2 list boxes.. there are 2 scenarios

1) Compare the 2 list boxes, with out selecting others list boxes

     in this case, I suggest compare the 2 fields in the Data modeling(Script) like,

     IF(Field1=Field2,Field1) as New_Field (Use New_Field in List Box)

2) Comparison depends on the other selections as well, then in List box use the bellow expression

     IF(Field1=Field2,'Field1')

rajeshforqlikvi
Creator
Creator

Its better to export the values of list box in excels and now keep both the column in a single excel file and write the formula like if (A1=A2, 'True',False) in the third column.

I hope this will work for you.

Not applicable
Author

Hi All,

It is showing an error on both of the above for Krishna and Sebastian. if(ListBox1Field = ListBox2Field,ListBox1Field ) and aggr(only({<Field1=P(Field2)>}Field1),Field1). I need your help to find the common values for both Dec and Nov.Capture.PNG

Capture1.PNG

Thanks,