Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

Visual Studio 2008 - name with more than one visit. I need an expression to count a distinct name ID on a date

I have a Visual Studio 2008 report with name, nameID (hidden), date of service, DOB and several other columns. I need to count the distinct name visits (using the name ID and date of service). Some names have more than one date of service with more than 1 transaction (names=30, datesvc=36, transactions=80).
 They are grouped by Name, NameID (hidden), DateSvc, Transaction. I thought Count(DateSvc) would work but it gives me the same amount of transactions, not visits. Any help is appreciated.

I can't put a sample of the data due to confidentiality. But here's a typed sample of it:
 Name......DateSvc......DOB......Trans......More columns
 DOB to the right can be several rows depending on the transaction
 Service Date can span one or several rows depending on the date of the transaction
 The name spans all rows for that persons transactions on the specific service date
 Name1.....1/1/16.....9/5/2008.....trans 1 for that day
 ...............1/4/16.....9/5/2008.....trans 1 for that day (same person)
 ...............1/4/16.....9/5/2008.....trans 2 for that day (same person)
 Name2.....6/9/16.....3/7/2002.....trans 1 for that day
 Name3.....6/9/16.....5/1/2000.....trans 1 for that day

 This should show 3 names, 4 visits and 5 transactions
 The 4 visits is where I'm having the problem.

When I try   =CountDistinct(Fields!DatesSvc.Value,"NameID")
I get:  The Value expression for the text box 'TextBox256' has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region or the name of a dataset.
I'm placing the expression in a separate tablix above the table. I want that information (totals) separate and if the user wants to see the details, they can click to toggle and see the info below
0
Lisa Randle
Asked:
Lisa Randle
1 Solution
 
Lisa RandleDatabase ConsultantAuthor Commented:
Nevermind!!!  I found out its considered a Complex Expression.  
I used:  Total Visits: =CountDistinct(Fields!Name.Value & "-" & Fields!Date.Value)
Complex Expressions:  https://msdn.microsoft.com/en-us/library/dd220516.aspx#Anchor_2
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now