Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression Error02

I have two tables like the following picture :

test.png

I need to make the amount become with and like the following:

1 – Invoice

2 – Finance Charge

3 – Misc Charge

4 – Return

5 – Credit Memo

6 – Payment

-----------------

I try this expression but it doesn't work!

=if(([R_Document Type]) = 'Credit Memo' & 'Payment',( -1 * ([R_Document Amount])),([R_Document Amount]))

1 Solution

Accepted Solutions
PrashantSangle

Hi,

try like

if(wildmatch([R_Document Type],'*Credit Memo*','*Payment*'),-1*[R_Document Amount],[R_Document Amount])

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

6 Replies
eduardo_sommer
Partner - Specialist
Partner - Specialist

The field name were missing after the and (which in fact shoul be an OR)

Also, the & operand concatenate both strings.

=if([R_Document Type] = 'Credit Memo' OR [R_Document Type] = 'Payment',( -1 * ([R_Document Amount])),([R_Document Amount]))


Eduardo

Anonymous
Not applicable
Author

it's still plus !!

Regards,

PrashantSangle

Hi,

try like

if(wildmatch([R_Document Type],'*Credit Memo*','*Payment*'),-1*[R_Document Amount],[R_Document Amount])

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
eduardo_sommer
Partner - Specialist
Partner - Specialist

Where did you put this expression? In the load script or UI Object?

Anonymous
Not applicable
Author

thanks it's working

Kushal_Chawda

try

=if(match(lower([R_Document Type])=,'credit memo', 'payment'),( -1 * ([R_Document Amount])),([R_Document Amount]))