Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

1 Solution

Accepted Solutions
Not applicable
Author

Mhh it seems to work for me.

Ive attached my test doc

View solution in original post

21 Replies
PrashantSangle

Hi,

Use calculated dimension

Try

Dimension_Name* -1

or

-Dimension_Name

And Click on + symbol

You will get

Font Color Option     write

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 Max, but will that turn the whole dimension negative? I only want certain transaction types in the dimension to be negative and red

Thanks

Not applicable
Author

Multiply the expression by -1 will make your value negative

Then If you want it only to appear in red if it is less than 0 you can add a condition:

Capture.PNG.png

PrashantSangle

Hi,

In calculated dimension you can use If()

like

If(wildmatch(Transaction_type,'A','B'),-ConvertDimension,ConvertDimension)

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 Carly, the only issue i have is that i just want certain transaction types to be negative in the dimension, not all of them

Kind regards

kevin

Not applicable
Author

Dimension_Name* if( [Transaction Types] = 'Credit Note' or [Transaction Types] = 'Credit Journal', -1, 1)

krishna20
Specialist II
Specialist II

Hi Kevin,

After your expression write <0,Red().

like

if(if(TXN_TYPE='Credit',sum(Invvalue))<0,Red())

Hope it helps.

Regards

Krishna

Not applicable
Author

Thanks, now i get a new field with -1 for Credit Notes, how do i get the 'Inv Value' which is an expression to go negative and red??

Sorry i am not explaining this very well!!

Thanks for your help

kevin

Not applicable
Author

You need to change the expression to this (leave demension as was):

Full_Inv Value_Expression * if( [Transaction Types] = 'Credit Note' or [Transaction Types] = 'Credit Journal', -1, 1)