Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
GregRyder
Contributor III
Contributor III

Help with counting formula

Hi

I am trying to count the number of transactions where loyalty flag is 1.

Here is my formula so far

if(Loyaltyflag=1, (Count(distinct If(TCODE='IN', REFERENCE))))

Loyalty flag is either 1 or 0

TCODE stands for transaction

REFERENCE is the invoice number

it says there is no error but it is not returning a value

Thanks

Greg

 

Labels (3)
1 Solution

Accepted Solutions
avinashelite

If its not returning value means , either it doesn't have data or the conditions are not correct, check the data once. 

Better way to do is using set analysis 

count(distinct  {<Loyaltyflag={1}, TCODE={'IN'}>} REFERENCE)

View solution in original post

2 Replies
avinashelite

If its not returning value means , either it doesn't have data or the conditions are not correct, check the data once. 

Better way to do is using set analysis 

count(distinct  {<Loyaltyflag={1}, TCODE={'IN'}>} REFERENCE)

GregRyder
Contributor III
Contributor III
Author

Hi

Thanks that worked and I also gave the idea how to fix my formula.