Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting a dimension value to negative and change color font

Hi, i have a dimension called 'Transaction Type' and a expression called 'Inv Value'. in a pivot table.

There are 12 'Transaction Types'. I want the expression values for two specific 'Transaction Types' - 'Credit Note & Credit Journal' to be shown as negative numbers, so a minus in front -123.00, and to be displayed in a red font.

Can anyone help please?

Kind regards

Kevin

21 Replies
Not applicable
Author

Thanks Krishna, i have done the following:

if(Transaction Type='Credit Note',sum(Inv Value))<0,Red()

The Inv Value is a expression, and is a calculation

But it says error in expression??

PrashantSangle

Hi,

try

if(Transaction Type='Credit Note' and sum(Inv Value)<0,Red())

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 🙂
Not applicable
Author

Thanks for your patince Carly, sorry still learning this. Okay i now have the following expression, but it returns a blank

Sum ([Amount GBP])* if( [Transaction Type] = 'Credit Note' or [Transaction Type] = 'Credit Journal', -1, 1)

Not applicable
Author

Thanks Max, the expression is okay,

=if([Transaction Type]='Credit Note' and sum([Amount GBP])>0,Red())

but no data??

Thanks for your help

PrashantSangle

Hi,

Try like

if(wildmatch([Transaction Type],'Credit Note','Credit Journal'),-Sum([Amount GBP]),Sum(Amount GBP))

or

if(wildmatch([Transaction Type],'Credit Note','Credit Journal'),Sum([Amount GBP])*-1,Sum(Amount GBP))

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 🙂
Not applicable
Author

Okay so again diemsnion works okay

=if(wildmatch([Transaction Type],'Credit Note','Credit Journal'),Sum([Amount GBP])*-1,Sum([Amount GBP]))

But field says error in calculated dimension?

Not applicable
Author

Mhh it seems to work for me.

Ive attached my test doc

PrashantSangle

Hi,

Sum(Amount GBP) is a expression you can use it in calculated dimension..

It will give you error

write this as expression

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 🙂
Not applicable
Author

Got it!!

Thanks so much for your help

krishna20
Specialist II
Specialist II

Hi Kevin,

I think you have missed if condition.place it correctly and try it with your condition.

Regards

Krishna