Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Date | ID |
8/23/2021 | 2 |
8/26/2021 | 3 |
8/26/2021 | 3 |
Required Result:
Date | ID/Day |
8/23/2021 | 1 |
8/26/2021 | 2 |
8/26/2021 | 2 |
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?
Count({<ID = {"=len(ID)>0"}>} ID)
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.
Date | ID | Items | Department | SKU | |
8/23/2021 | 2 | LG456 | DGF | LG331002 | |
8/23/2021 | Null | Null | Null | ||
8/23/2021 | Null | Null | LG330 | ||
8/23/2021 | Null | Null | Null | ||
8/26/2021 | 3 | LG375 | KML | LG229870 | |
8/26/2021 | 4 | LG356 | DGF | LG334621 | |
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null |
Desired Table:
Date | ID | Items | Department | SKU | Desired Col |
8/23/2021 | 2 | LG456 | DGF | LG331002 | 1 |
8/23/2021 | Null | Null | Null | ||
8/23/2021 | Null | Null | LG330 | ||
8/23/2021 | Null | Null | Null | ||
8/26/2021 | 3 | LG375 | KML | LG229870 | 2 |
8/26/2021 | 4 | LG356 | DGF | LG334621 | 2 |
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null | ||
8/26/2021 | Null | Null | Null |
Thanks again for putting in the time and effort!
Regards,
JonesBeach
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?
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!
I apologize that line of code worked perfectly, appreciate the help!