Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
twanqlik
Creator
Creator

Simple count is not working properly

I have a simple table with only 4 fields and I want to calculate the distinct consumers that have an 'EmailTypeSent' = Welcome*.

This is working fine untill i filter in the EmailTypeSent on another value than Welcome*.

As is shown in the image, when i select 'Other' it still gives a 2 as count. However, it should give 0, because there are 0 email addresses in the filtered table with an 'EmailTypeSent' = Welcome*.

What is wrong with the used formula? The table shows the right records.

=count(DISTINCT{<EmailTypeSent={'Welcome*'}>} EmailAddress)

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Count(DISTINCT{<EmailTypeSent *= {'Welcome*'}>} EmailAddress)

View solution in original post

16 Replies
sunny_talwar

Try this:

=Count(DISTINCT{<EmailTypeSent *= {'Welcome*'}>} EmailAddress)

Anonymous
Not applicable

Hi,

This is because the set analysis is specific to Welcome son no matter what ypu select, it will only show the count where EmailTypeSent is "Welcome*"

ahaahaaha
Partner - Master
Partner - Master

Hi,


Thaband rights, try


=count(DISTINCT{<EmailTypeSent={"Welcome*"}>} EmailAddress)


Regards,

Andrey

twanqlik
Creator
Creator
Author

Wauw this works, thank you! Now i'm trying to understand why your formula works and mine not

Not working:

=count(DISTINCT{<EmailTypeSent={'Welcome*'}>} EmailAddress)

Working:

=Count(DISTINCT{<EmailTypeSent *= {'Welcome*'}>} EmailAddress)


The only difference is the extra *.

sunny_talwar

Read here about Implicit Set Operators

twanqlik
Creator
Creator
Author

Thank you that helps!

I have a similar question, maybe you can help me with that as well

Simple table, 2 colums:

EmailAddress

URL_CTA_Code

I want to calculate the number of distinct email addresses that have a 'bh' as URL_CTA_Code, however, the count is showing 9 and should be 0 in my example.

9 is the total count of unique email addresses. I noticed that this formula is only working when at least one consumer has a URL_CTA_Code, when they are all blank it doesn't work anymore. What i'm doing wrong?

=count({<URL_CTA_Code*={'bh'}>}DISTINCT EmailAddress)

test3.png

sunny_talwar

Not sure how your data model looks like, but may be try this

=Count({<URL_CTA_Code*={'bh'}>}DISTINCT URL_CTA_Code)

Assuming one - to - one relation between URL_CTA_CODE and EmailAddress fields.

twanqlik
Creator
Creator
Author

There is no data model, only one excel sheet with the 2 fields thats it.

Therefore there is no 1 - 1 relationship between the 2 fields. Your formula is showing the distinct count for the URL CTA Code without looking at the email addresses, that is missing

Anymore ideas ?

sunny_talwar

Your expression seems to be working well for me

Capture.PNG