Joined: 23 Jan 2012
Location: United States
Online Status: Offline
Posts: 7
Topic: distinct count Formula help Posted: 11 Apr 2017 at 5:04am
All
I'm having an issue with doing a distinct count.
I have a field that represents an account number and it has letters and numbers, so it's a string. I have the field grouped and anytime the account number appears more than once, I want it to be counted once.
example of data
group
3/29/16 lisdexamfetamine Z921936
3/22/16 guanFACINE ER Z921936
I want to count that account number 1 per group
I created a variable that's a number that will return a 1 if there's an account number or a zero if not but that won't let me summarize either
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 12 Apr 2017 at 9:48am
I did not read specifically what you are trying to achieve. But generally you have three formulas. One to reset the shared variable (you could use global variables but they do not work for me for some reason), i.e., shared numbervar counter := 0; normally in the report header or a group header. Second the calculation; shared numbervar counter; if someconditon the counter := counter +1; Then the third formula to either display the value or use it in another formula.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 17 Apr 2017 at 6:51am
you can also consider a formula that concatenates the group field value with the account number and do a distinct count of that (at both group and report levels).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum