Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
antoniotiman
Master III
Master III

Value NULL in set analysis?

Hi,

How can I set value NULL  in set analysis?

sum({<CostoVen={NULL}>} Sales)   [convert from sum(if(IsNull(CostoVen),Sales)]

Tanks You

32 Replies
antoniotiman
Master III
Master III
Author

Sorry, my sum({$-<CostoVen={"%*%"}>} Sales) it doesn't work,

but your suggestion doesn't even work.

MayilVahanan

Hi

Try like this

Sum({<CostoVen-={"*"}>} Sales)


Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
antoniotiman
Master III
Master III
Author

Hi Mayil,

I have already tried. It doesn't work.

Thanks

Anonymous
Not applicable

I don't think that this is possible with set analysis.  The only way would be to have a 1/0 flag defined in the load script as jpapador mentioned earlier.

The reason why this isn't possible with SA is that set analysis basically functions like static user selections.  See my explanation in this thread: http://community.qlik.com/message/450877#450877.

Since QV doesn't allow selections of NULL values, it's not possible to create a set expression for NULL values.

Nicole-Smith

Actually Jeffrey Vermeire, it is possible to count null values using set analysis like the following:

=count({$-<Value={'?*'}>}Field)

Please see attached file for an example.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I  recommend reading the excellent paper "Null and Nothing" by Henric Cronström available at NULL handling in QlikView

In the section "NULLs and missing values in Set analysis", HIC shows three ways to select null in Set Analysis. Here's one way :

sum({1-<CostoVen={*}>} Sales)

-Rob

Anonymous
Not applicable

Jeffrey,

I've used the solution that Celambarasan Adhimulam showed here many times, and it worked.

I don't disagree though that adding flags in script makes things simpler.

Regards,

Michael


antoniotiman
Master III
Master III
Author

Thanks Jeffrey,

Thanks to Everybody.

I have not found solution.

I will continue to use  sum(if(IsNull(CostoVen),Sales)) that works well

or I modify the script inserting

NullAsValue CostoVen;

SET NullValue = 0;

and I reload the data.

Regards,

Antonio

Anonymous
Not applicable

Nicole,

There is no need for "?" here, unless you want to count blank values as nulls.

Regards,

Michael

Edit: in the attached, there are both versions