Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
narender123
Specialist
Specialist

how to Compare two tables value?

Hi All,

I have two tables suppose "Table A" with column "taxpair","taxno","Amount" and "Table B" with column "taxpair".I want to show the result like

if(taxno=1 and value of taxpair of table A is present in table B taxpair values then show "Individual"

but if(taxno=1 and value of taxpair of table A is not present in table B taxpair values then show "Individual-Enterprise"

?????????????

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable

Hi Narender,

It's working fine for me, plz check out the below attachments.

View solution in original post

15 Replies
narender123
Specialist
Specialist
Author

I have worked on  it in script and script is  executed well like

if(taxno=1 and taxpair=taxpair2,'Individual',

if(taxno=1 and taxpair<>taxpair2,'Individual-Enterprise'))

but in tablebox its doesn't show the individual ???

Here i have changed the column name of table B taxpair as taxpair 2.

manideep78
Partner - Specialist
Partner - Specialist

pls give sample data

narender123
Specialist
Specialist
Author

Thanks for reply.

Manideep Its not possible to give you data because its reside on my production sever where i cant copy the data .i have written the all information just like table A and table B in my above question .So could you give me the suggestion?

Thanks.

narender123
Specialist
Specialist
Author

Have anybody suggestion for me????????????

manideep78
Partner - Specialist
Partner - Specialist

Take Straight table instead of table box.

Check the attached qvw

hope it helps and let me know whether it is your requrired output or not??

narender123
Specialist
Specialist
Author

Thanks Manideep.

But if u see ur attachment then u will find there.. Taxpair=Taxpair2 not working and the result always shows the value for Taxpair<> Taxpair2.Means its not working for "=" sign between 2 tables and return the else part wherever that is..

I have already found this problem.But its not the solution.

Can you give me some other solution please.

Thanks.

manideep78
Partner - Specialist
Partner - Specialist

Please find this

narender123
Specialist
Specialist
Author

Thanks Manideep.

In your qvw ,if we take all dimention its working but i take tax pair and amount dimention.Like this

Taxpair                               Amount

Individual                            100000000 

Individual_Enterprise            200000000

property                              250000000

enterprise                            1500000000

condition :1) taxno=1 and taxpair=taxpair2 then individual

                 2)taxno=1 and taxpair<>taxpair2 then individual-enterprise

                3) taxno=2 then property

               4)  taxno=3 then enterprise

This is just like sample data.So now you can help me easily.

Thanks in advance.

Not applicable

Hi,

I would suggest a new idea:

Try to research alternate states.

With set analysis and states you can compare 2 kinds of tables. Let me know if you require an example document.

Kind Regards,

Dion