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

I want to counts the IDs by date field but due to applied conditions the nulls come into play and mess up the calculation....

I want to counts the IDs by date field but due to applied conditions the nulls come into play and mess up the calculation. 

Mock Data:

DateID
8/23/20212
8/26/20213
8/26/20213

 

Required Result:

DateID/Day
8/23/20211
8/26/20212
8/26/20212
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

ok, i still may not understand but maybe this is better...

Count(DISTINCT Total <Date> {<ID = {"=len(ID)>0"}>} ID)

 

Nevermind on the above.  Looks like you are trying to assign new IDs to rows?

View solution in original post

5 Replies
stevejoyce
Specialist II
Specialist II

Count({<ID = {"=len(ID)>0"}>} ID)

JonesBeach
Contributor III
Contributor III
Author

Thanks so much Stevejoyce for the answer but it returns all 1s. 

On contrary I think I did not do a very good job in explaining my query so let me pls try again,

Here is the mock table pls note that I am hiding all the null rows  because they are out of scope. 

DateIDItemsDepartmentSKU 
8/23/20212LG456DGFLG331002 
8/23/2021 NullNullNull 
8/23/2021 NullNullLG330 
8/23/2021 NullNullNull 
8/26/20213LG375KMLLG229870 
8/26/20214LG356DGFLG334621 
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 

 

Desired Table:

DateIDItemsDepartmentSKUDesired Col
8/23/20212LG456DGFLG3310021
8/23/2021 NullNullNull 
8/23/2021 NullNullLG330 
8/23/2021 NullNullNull 
8/26/20213LG375KMLLG2298702
8/26/20214LG356DGFLG3346212
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 
8/26/2021 NullNullNull 

 Thanks again for putting in the time and effort!

Regards,

JonesBeach

stevejoyce
Specialist II
Specialist II

ok, i still may not understand but maybe this is better...

Count(DISTINCT Total <Date> {<ID = {"=len(ID)>0"}>} ID)

 

Nevermind on the above.  Looks like you are trying to assign new IDs to rows?

JonesBeach
Contributor III
Contributor III
Author

Hi Steve I tried the code but it doesnt seems to work, i have made changes to the above tables for them to make more sense. 

I have tried other options like: 

=sum(aggr(count(distinct[EVENTID]),[CC_FACILITY]))

this does the job but adds all the null rows for IDs which gives the wrong output. Thanks!

JonesBeach
Contributor III
Contributor III
Author

I apologize that line of code worked perfectly, appreciate the help!