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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Specialist III
Partner - Specialist III

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

View solution in original post

2 Replies
m_woolf
Master II
Master II

I'll state the obvious:

     Year(Opportunity.CreatedDate) <> $(vCurrentYear

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

jagannalla
Partner - Specialist III
Partner - Specialist III

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