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

Regarding comparing 2 field values

Hi,

I appreciate your time. I am trying to compare 2 field values and show the  3rd field called amount if they are same. I tried below but getting duplicate row.

=if(sales_vendor = volume_vendor,amount,'-')

I tried the above in an Qlik Sense table expression, but I am getting duplicate row. First row with amount and the second row with a '-'

some thing like below

sales_vendor,product,sales,amount

1,A,10$,5

1,A,10$,-

I have unchecked to include null values option.

Thank you!

 

Labels (1)
2 Replies
sidhiq91
Specialist II
Specialist II

@SK111 Could you please follow the below code:

NoConcatenate
Temp:
Load Sales_Vendor,
Product_Vendor,
if(Sales_Vendor=Product_Vendor,Amount,null()) as Amount

inline [
Sales_Vendor, Product_Vendor, Amount
10,10,5
11,11,6
12,14,7
13,12,8
];

Exit Script;

In your expression '-' is not considered as null, hence the issue.

If my solution resolves your issue, please like and accept it as a solution.

SK111
Contributor II
Contributor II
Author

Hello,

Appreciate your time. I am trying to apply this in the chart expression,since the sales_vendor is an example but its the vendor who logins into the report. 

=if(login_vendor =[Vendor],Amount,null()) 

But if condition takes lot of time to reload the chart. Is there any other alternative to remove this if condition.

Thank you!