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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Wuttikorn
Contributor II
Contributor II

How to Count Distinct in 2 requirement

Hi , All . I am a new member on this group . Nice to meet you. All. 

         I am trying to count distinct branch_no for Q1-2561 but it's not working. 

I just count only branch_no for Q1-2561  but not distinct branch_no

 

Ex.     Count(if([Quarter]='Q1-2561',[branch_no]))

 

Can anyone help me?     Thank you very much.

1 Solution

Accepted Solutions
Wuttikorn
Contributor II
Contributor II
Author

Thank you for PrashantSangle.

This formula can use  :  Count(distinct if([Quarter]='Q1-2561',[branch_no]))

 

Thank you very much for you and all people. I am a beginner for Qliksense program. 

 

View solution in original post

6 Replies
Anil_Babu_Samineni

Simply use set analysis like

Count(DISTINCT {<Quarter={'Q1-2561'}>} branch_no)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle

use keyword distinct.
1: Count({<Quarter={'Q1-2561'}>} Distinct branch_no)
2: Count(distinct if([Quarter]='Q1-2561',[branch_no]))
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Wuttikorn
Contributor II
Contributor II
Author

Thank you. loveisfail.

But I count only branch_no in year Q1-2561 that remove duplicated branch_no.

 

Anil_Babu_Samineni

You want without unique count? Try this to ignore Distinct statement

Sum({<Quarter={'Q1-2561'}>} Aggr(NODISTINCT Count({<Quarter={'Q1-2561'}>} branch_no),branch_no))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Wuttikorn
Contributor II
Contributor II
Author

Thank you for PrashantSangle.

This formula can use  :  Count(distinct if([Quarter]='Q1-2561',[branch_no]))

 

Thank you very much for you and all people. I am a beginner for Qliksense program. 

 

Wuttikorn
Contributor II
Contributor II
Author

Thank you  loveisfail very much. I can use your formula to apply for another one.