Count Unique Value In WW4

Hi Guys

I just don't know how to get the expression correctly. How do I count unique value in week 4 ?  I create this expression but don't know where is my  mistake. It call 20 instead of the correct answer 14.

COUNT(SELECT(NC DOC[PROCESS/PROJECT OWNERSHIP],AND(TRUE,TRUE,[_THISROW].[WW]=[WW])))

desmond_lee_0-1707966271693.png

 

Solved Solved
0 4 97
2 ACCEPTED SOLUTIONS

Suvrutt 

Thnak you again for responding to me. I put a count because the result is a number and TRUE,TURE is do remove duplicate. I try your expression there is an error but I put a count to count the list the answe is correct i.e. 14 See row 5 work week 4

desmond_lee_0-1707969607331.png

 

View solution in original post

Yes, sorry there was a typo in my suggestion. UNIQUE() will produce a list of no duplicate items. You then need to use COUNT() on the list of UNIQUE() items.

I have corrected it in the original post also to avoid any confusion by future readers of the post thread.

I believe you can simply try

COUNT(UNIQUE(SELECT(NC DOC[PROCESS/PROJECT OWNERSHIP],[_THISROW].[WW]=[WW])))

 

View solution in original post

4 REPLIES 4

Please use UNIQUE() instead  of  before COUNT()

COUNT(UNIQUE(SELECT(NC DOC[PROCESS/PROJECT OWNERSHIP],AND(TRUE,TRUE,[_THISROW].[WW]=[WW]))))

UNIQUE() - AppSheet Help

In general  such expressions if used in VC etc. can be very sync time expensive. If you are trying to count for a specific week at a time, please try using a slice to filter records for that week and then running UNIQUE() on those filtered records.

Edit: Made changes in above suggestion as there was an inadvertent error in suggestion.

Suvrutt 

Thnak you again for responding to me. I put a count because the result is a number and TRUE,TURE is do remove duplicate. I try your expression there is an error but I put a count to count the list the answe is correct i.e. 14 See row 5 work week 4

desmond_lee_0-1707969607331.png

 

Yes, sorry there was a typo in my suggestion. UNIQUE() will produce a list of no duplicate items. You then need to use COUNT() on the list of UNIQUE() items.

I have corrected it in the original post also to avoid any confusion by future readers of the post thread.

I believe you can simply try

COUNT(UNIQUE(SELECT(NC DOC[PROCESS/PROJECT OWNERSHIP],[_THISROW].[WW]=[WW])))

 

Thank you very much

Top Labels in this Space