Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show value in an expression

I used the following formula but it isn't working as i hoped it would be:

 

=

if((sum(_namefield)/sum(_namefield))<0.3,Red(),Black())

I want all values <0.3 to be in red but nothing is happening when i use the formula above.

Someone knows haw to solve my problem?

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

The expression you wrote will always return "1", because it is always dividing the value of each cell into itself. You might mean

=if(sum(_namefield) / sum(TOTAL _namefield) < 0.3, Red(), Black())

That will divide the value in each cell by the value of the entire column.

Hope that helps.

Miguel

View solution in original post

8 Replies
rajni_batra
Specialist
Specialist

sum(_namefield)/sum(_namefield)

i think u have mistaken it will return always one i think it should be

sum(_namefield)/total sum(_namefield)


Not applicable
Author

Maybe i should have been more clear.

The first 'namefield' isn't the same as the second.

Lets assume the first one is 10 and the second one is 100

Take the formula above into account and the result should be 0,10 and should turn red of course.

That last part isn't happening.

Do you need more info?

Miguel_Angel_Baeyens

Hi,

The expression you wrote will always return "1", because it is always dividing the value of each cell into itself. You might mean

=if(sum(_namefield) / sum(TOTAL _namefield) < 0.3, Red(), Black())

That will divide the value in each cell by the value of the entire column.

Hope that helps.

Miguel

rajni_batra
Specialist
Specialist

can u post demo values

whiteline
Master II
Master II

svangrimbergen,

Your sums are the same.

I understand that you expects something different but don't understand what.

Could you discribe, where you use this expression and what result you want to achieve.

sreenivas
Creator III
Creator III

if(Sum(_namefield)/Above(Sum(_Namefield) < 0.3, Red(), Black())

whiteline
Master II
Master II

=if(Sum(_namefield)/Above(Sum(_Namefield)) < 0.3, Red(), Black())

Not applicable
Author

Thanks Miguel. It works!