Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Why does If statement show Null

if(Year(Opportunity.CreatedDate) = $(vCurrentYear),

     if(Year(Quote.CreatedDate) = $(vCurrentYear), 

          if(Quote.GrandTotal >= 0, 1, 0))) as Quotes

Why does this come back Null?

This is off a resident load.

1 Solution

Accepted Solutions
jagannalla
Valued Contributor III

Re: Why does If statement show Null

Hello,

1. If Year(Opportunity.CreatedDate) = $(vCurrentYear) is false then it takes null.

2. If if(Year(Quote.CreatedDate) = $(vCurrentYear) is false then it takes null.

3. If both conditions are true then it enters the third condition. Here if the condition is true then it holds 1 otherwise 0.

But in first two conditions if it is false it stores Null values.

Cheers!!

Jagan

2 Replies
mwoolf
Honored Contributor II

Re: Why does If statement show Null

I'll state the obvious:

     Year(Opportunity.CreatedDate) <> $(vCurrentYear

or     Year(Quote.CreatedDate) <> $(vCurrentYear)

jagannalla
Valued Contributor III

Re: Why does If statement show Null

Hello,

1. If Year(Opportunity.CreatedDate) = $(vCurrentYear) is false then it takes null.

2. If if(Year(Quote.CreatedDate) = $(vCurrentYear) is false then it takes null.

3. If both conditions are true then it enters the third condition. Here if the condition is true then it holds 1 otherwise 0.

But in first two conditions if it is false it stores Null values.

Cheers!!

Jagan

Community Browser