I am trying a query SQL in Salesforce to count the number of click per user on one link. However, the count column stays empty even tough my query looks good from a syntax point of view.

Here is my query:

SELECT subscriberkey, bannername, COUNT(bannername) AS freq
FROM tablebanner
GROUP by subscriberkey, bannername

Any ideas?

  • salesforce.stackexchange.com/questions/192800/…
    – user7601
    Sep 28, 2017 at 9:09
  • The query is correct. I attempted it inside my own system with dummy data and results were as expected. What are the settings for your target DE? If it is a large query, it could take up to 30 minutes or so for it to push data in. Sep 28, 2017 at 17:32
  • My bad, I just misspelled the word freq! :)
    – Emilie
    Oct 5, 2017 at 16:38
  • would you mind adding an answer to your own question, and accepting it (takes 48 hrs i believe) =) Thanks!
    – glls
    Oct 23, 2017 at 19:28

2 Answers 2


It was just a spelling mistake from my side (misspelling of "freq"). Works great now.



You are grouping and counting the same column BannerName .You need to Group By Similar values and Count 'Distinct' Values. For example, If you want to count the number of Employees in a particular department.

The table structure being like this:

EmployeeName - DepartmentName

  1. Employee ABC - Dep A
  2. Employee XYZ - Dep B
  3. Employee PQR - Dep A

Here you would group by department name and count EmployeName. Hope this clarifies.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .