Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hkg_qlik
Creator III
Creator III

Count Error

Hi,

The business rule is that If i login multiple times on the same date the count of PersonID associated with me should be one for that day.

Currently I am have issue with that when I am trying to show the count of PersonID in terms of Month - year.

If i am using date field and counting the PersonID its giving me a correct count as i can do distinct and count the no. of rows.

Please look at the attached .qvw and the excel data.

Thanks,

H

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try using

=count(aggr(PersonID,Date,PersonID))

or

=sum(aggr(count(distinct PersonID),Date))

View solution in original post

7 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use expression as

     Count(DISTINCT PersonID&Date)

Celambarasan

swuehl
MVP
MVP

Or try something like

=count(aggr(PersonID,Date))

hkg_qlik
Creator III
Creator III
Author

I tried both the expression but the count which reflects in the table with date(Marked Orange) which is 121 should match when I am showing it by Month and Year.

Thanks,

H

swuehl
MVP
MVP

Hm,

if I use my expression in your tables using Month or Year as dimension, I get 15 as result, which seems to me the correct answer. What do you get /expect?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You should rewrite your expression as

     If(Count(DISTINCT PersonID) > 0, Count(DISTINCT PersonID&Date))

because you have calendar months without person id mapped.

Celambarasan

swuehl
MVP
MVP

Try using

=count(aggr(PersonID,Date,PersonID))

or

=sum(aggr(count(distinct PersonID),Date))

hkg_qlik
Creator III
Creator III
Author

Thanks for the Expression suggestions.

Swuehl : =sum(aggr(count(distinct PersonID),Date))

This works for me.

Regards,

H