Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9123167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:16:25+00:00 2026-06-17T06:16:25+00:00

I have a report with two tables. The first table is a list of

  • 0

I have a report with two tables. The first table is a list of clients, detailing each client that falls into one category of three with different items for each client. The SQL joins up a client_table with the client_items table (there can be multiple items per client) the SQL results looks like so:

Type    ClientID    ItemID
A       1           1
A       3           1
A       3           2
B       2           1
B       4           3
C       5           2

My second table is going to return counts of the distinct ClientIDs from various combinations of the types:

  • Total (A+B+C) – I’ve got this one figured out with =CountDistinct(Fields!ClientID.Value,"datasource1")

  • Type B+C – Distinct ClientIDs where the type is B or C

  • Type C – Distinct ClientIDs where the type is C

I hope that was clear, if not let me know what I need to add to clear it up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:16:26+00:00Added an answer on June 17, 2026 at 6:16 am

    CountDistinct() counts non-null values, so you could use an expression to null out those values you don’t want to count and do something similar to your first value.

    Type B+C:

    =CountDistinct
    (
      IIf
      (
        Fields!Type.Value = "B" or Fields!Type.Value = "C"
        , Fields!ClientId.Value
        , Nothing
      )
      , "datasource1"
    )
    

    Type C:

    =CountDistinct
    (
      IIf
      (
        Fields!Type.Value = "C"
        , Fields!ClientId.Value
        , Nothing
      )
      , "datasource1"
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report with two separate tables referencing two separate datasets. The first
I have two list of different objects : List<Report> List<Newsletter> each having a 'created
I have two tables in my database that Im trying to use one Query
I have two MS Reports with each their own dataset. The first one works
Can you have two tables in Visual studio 2008 report (in the report control)
I have a problem with CR (version that ships with VS2008). Report has two
I have a main report that prompts the user to enter two parameters (@ORI
I have two objects List<Report> List<Newsletter> I need certain properties like Id Date Status
I have a grid view that has two simple columns, a report number and
I have two tables in my MySQL database (table1 and table 2). I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.