Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

p_quirke_
New 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
Contributor III

Re: Issue with IF in an expression

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.

5 Replies
Or
Valued Contributor II

Re: Issue with IF in an expression

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_
New Contributor II

Re: Issue with IF in an expression

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
Contributor III

Re: Issue with IF in an expression

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

balar025
Contributor III

Re: Issue with IF in an expression

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.

p_quirke_
New Contributor II

Re: Issue with IF in an expression

Ravi,

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

Paul

Community Browser