Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
p_quirke_
Contributor II
Contributor II

Issue with IF in an expression

Hi,

I have a waterfall chart where values which are positive are green and values which are negative are red.

This works as expected.

My issue becomes more complex when i try to add the condition for the Total Column (in yellow).

The requirement is to have the Total coluum in another colour.

I am using the Dimensionality() =0 to identify the total column. This works outside of the IF statement.

However when I add this to the exisiting condition nothing happens.

Am I not seeing something obvious?

Any help appreciated.

Here is the expression for the background colour and the current graph

if(column(1)>0, Green(),

if(Dimensionality()=0, Black(),Red()))

Bonus equestion how do I identify the others colum in a table where the others is a result of a limited dimension.

May thanks in advance!

Paul

1 Solution

Accepted Solutions
balar025
Creator III
Creator III

Hello ,

Use below expression.

if(RowNo()=1 or Dimensionality()=0,0,RangeSum(Above(sum(Value),1,RowNo())))

Background Color:- if(Dimensionality()=0,Yellow(),if(Column(1)>0,Green(),Red()))

please find attached application for reference.

View solution in original post

5 Replies
Or
Master II
Master II

I feel like I'm missing something here, so I'll just ask: in your condition, if Column(1)>0, the result is always Green(). Your total is >0. Why shouldn't it be green?

p_quirke_
Contributor II
Contributor II
Author

Or firstly thanks for your answer. It's much appreciated. I understand what you are saying.

The dimensionality of the Total colum is 0 so I was hoping that the Dimensionality()=0 would set the Black.

I see that my logic is wrong. Have you any idea how to go about this?

balar025
Creator III
Creator III

It is achievable. I don't have application handy.Can you please post your demo application?

balar025
Creator III
Creator III

Hello ,

Use below expression.

if(RowNo()=1 or Dimensionality()=0,0,RangeSum(Above(sum(Value),1,RowNo())))

Background Color:- if(Dimensionality()=0,Yellow(),if(Column(1)>0,Green(),Red()))

please find attached application for reference.

View solution in original post

p_quirke_
Contributor II
Contributor II
Author

Ravi,

Thanks so much!! This work. I should have played with my statement more. Thanks again for your help

Paul