Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoARaymundo
Creator III
Creator III

how to count null records

Hi!

Table A

YEARMONTHPROVIDER
201308P0004
201308P0003
201308P0002
201307P0002
201307P0001
201306P0003

SELECTIONS >> YEAR=2013, MONTH=08

I need count the suppliers like this:

IDDESCRIPTIONAMOUNT
1NORMAL "P0002"1
2NEW "P0004"1
3REACTIVATED "P0003"1
4LOST "P0001"1

My problem is how to count the ID 4.

Any Idea?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
salto
Specialist II
Specialist II

Hi,

maybe the expression could look like this:

=if(count({$<Month={$(=Max(Month))}>} Provider)>0 and count({$<Month={$(=Max(Month)-1)}>} Provider) > 0,

'Normal Provider',

if(count({$<Month={$(=Max(Month))}>} Provider)>0 and count({$<Month={$(=Max(Month)-1)}>} Provider)<=0 and count({$<Month={$(=Max(Month)-2)}>} Provider)>0,

'Reactivated Provider',

if(count({$<Month={$(=Max(Month)-1)}>} Provider)>=0 and count({$<Month={$(=Max(Month))}>} Provider)<=0,

'Lost Provider',

if(count({$<Month={$(=Max(Month)-1)}>} Provider)<=0 and count({$<Month={$(=Max(Month))}>} Provider)>0,

'New Provider')

Hope this helps.

swuehl
MVP
MVP

Maybe like this:

=count( {<Provider= e({<Month ={08}, Year = {2013}>})*p({<Month ={07}, Year = {2013} ) >} DISTINCT Provider)

i.e. using set analysis with implicite field value definitions ( i.e. p() and e() functions).

Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
MarcoARaymundo
Creator III
Creator III
Author

Tks SALTO, but I did that and it did not work.

Not applicable

Use the NullCount() function.

MarcoARaymundo
Creator III
Creator III
Author

tks G Wassenaar.

I have two questions:

1) When I select another month (ex 05), the provider P0005 in this month is a new provider and not reactivated. How to can resolved that?

2) In my example I have determined the "status" of providers, but in my app "status" is not a field, it is a calculated dimension. Applying the example you did in one dimension?

Gysbert_Wassenaar

1. See attached updated qvw.

2. I have no idea what you're trying to ask.


talk is cheap, supply exceeds demand
MarcoARaymundo
Creator III
Creator III
Author

Very Nice!

But, i think create a dimension STATUS can work better, see attached please.

Its possible put your expressions to work in dimension?

I need to better understand how to work with Indirect Set Analysis, is still confusing to me.

Thanks!