Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Null vs. Not Null

Good Morning Everyone,

I am trying to populate Accq_Inv_Gross with Inv Gross if Customer Group 4 is not null, and populate Davey_Inv_Gross with Inv_Gross if Customer Group 4 is Null, however my logic must not be correct. Any suggestions?

Thanks

If(len([Customer Group 4]) > 0, [Inv Gross],0) as [Accq_Inv_Gross],


if(isnull([Customer Group 4]),[Inv Gross],0) as [Davey_Inv_Gross],

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Thom

I dont see anything wrong with your logic. What is happening that is not correct?

Jonathan

PS I would use len([Customer Group 4])=0 rather than isnull, but that wont change the results

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Thom

I dont see anything wrong with your logic. What is happening that is not correct?

Jonathan

PS I would use len([Customer Group 4])=0 rather than isnull, but that wont change the results

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Thom

I agree with Jonathan, that the logic is OK.

Check to see if the actual value you are checking are really null.

If you load numbers from Excel tables, QV will translate nulls on the sheet into "" in QV (blank string rather than a true null).

tmumaw
Specialist II
Specialist II
Author

Thanks. It works fine. I changed the isnull to length = 0. I have another question. I want to do a count distinct customers. I tried this but with no luck. I'm having a hard time with the Great Than sign since set analysis also uses it.

Count({$<(len([Customer Group 4]) > 0>} distinct Customer

Thanks

Not applicable

Hi, try this:

Count({$< [Customer Group 4] = {"=len([Customer Group 4]) > 0"} > } distinct Customer)

Best Regards

tmumaw
Specialist II
Specialist II
Author

Ivan,

You have just made my Friday and weekend. Thanks for all your help yet again.

Thom

tmumaw
Specialist II
Specialist II
Author

Jonathan and Bruce,

You both also made my Friday much more enjoyable. Have a great weekend.

Thom