Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
DragonSlayer
Contributor

Count the number of times unique ID's appear

Hi everyone.

To give a bit of a background as to my issue. Briefcam is the software that analyzes the video feeds coming in and then creates data. Qlik is then used to create the dashboards within Briefcams research tab. I can then create any visuals and graphs I want. 

My issue is as follows:

I need to know how many times a unique visitor has come back into the story the same day, and how many times they have come back during a week and month?.

Currently I can get the number of unique visitors(number of identified visitors) and if they have returned to the store(showed up in the video feed again, or in a different camera). View below highlighted.

BC unique.PNG

The code used for in the highlighted box is:

# of unique is:

=count(distinct {$<[Watchlist]-={'Employees'}>} FaceID

# of new is:

=count(distinct {$<[Watchlist]-={'Employees'}>} FaceID) - count(distinct {$<[isNew]={'0'},[Watchlist]-={'Employees'}>} FaceID)

# of returned is:

count(distinct {vDay<[isNew]={'0'},[Watchlist]-={'Employees'}>} FaceID)

Scenario:

 If these are the unique ID's that have come in:

Unique ID
255
256
257
255
245
246
267
255
256
257
255
256
222

 

Then I need the following output:

4 1 1 1 0 0 0
did not return returned once returned twice returned 3 times returned 4 times returned 5 times returned 6 times

 

This should give me a graph similar to this:

DragonSlayer_0-1652364599635.png

 

 

Labels (5)
5 Replies
rubenmarin

Hi, you can retirve the number of IDs that not returned with:

Sum(aggr(If(Count([Unique ID])=1,1),[Unique ID]))

The ones that returned once with:

Sum(aggr(If(Count([Unique ID])=2,1),[Unique ID]))

And so on...

MarcoWedel

maybe one solution could be:

MarcoWedel_0-1652721485090.png

using this dimension:

=Aggr(dual(Pick(Count(UniqueID),'did not return','returned once','returned twice','returned '&(Count(UniqueID)-1)&' times'),Count(UniqueID)),UniqueID)

 

and this measure expression:

Count(distinct UniqueID)

 

hope this helps

Marco

DragonSlayer
Contributor
Author

This works. The only issue is I have to hard code the number of returns, with a 30 day data set there might be someone who comes in every day or multiple times a day which would then have a return 30 times or more.

DragonSlayer
Contributor
Author

This works. To take it one step further. Is there a way to remove the limitation here =Aggr(dual(Pick(Count(FaceID),'0','1','2','3','4','5'&(Count(FaceID)-1)&' times'),Count(FaceID)),FaceID)

I have to manually enter 0,1,2,3,4,5,etc but it is possible that someone will appear 100 times in a month. Is there a way to let it go through an array/list? I am also unable to create my own variables.

 

MarcoWedel

sorry, forgot to limit the Pick value.

This should work and avoid hard coded values:

 

MarcoWedel_0-1654373469061.png

 

=Aggr(dual(Pick(RangeMin(Count(UniqueID),4),'did not return','returned once','returned twice','returned '&(Count(UniqueID)-1)&' times'),Count(UniqueID)),UniqueID)