Count distinct values in report builder

i have a situation where i have to count distinct number of customers.
i have a query which returns the list of values of bill_to_customer_id from ra_customer_trx_all table and i have to display only the number of distinct customers. i cant do this in the query because it has to be grouped and i am doing it in an aging report. i have to list the number of distinct customers in each aging period. can anybody please help me how to achieve this in reports 6i.
thanks

how can i count distinct values in reports?
the situation is like this
i have a query which lists customer_id, invoice number, amount due
so what i want is to count the distinct customer_id and display the number of distinct customers. one customer_id can be repeated any number of times but i should count it only once.

Similar Messages

  • How to display the count distinct in a report

    hi,
    i have a report with multiple columns in it and with column, say A; i need to display in a calculated column B how many distinct values there are in A across the entire report; how to do that?

    Hi.
    For example:
    CALENDAR_YEAR
    CALENDAR_MONTH_DESC
    count(distinct TIMES.CALENDAR_MONTH_DESC by TIMES.CALENDAR_YEAR)
    Count will give you how many distinct months are in year.
    Regards
    Goran
    http://108obiee.blogspot.com

  • Count distinct values current group

    Hi--
    Is there a way to count the distinct values within the current group? ie--i've got a PO and want to display all the addresses at the shipment level if there is more than one distinct one, but if they are all the same as the header-level address, then I don't want any of them to show up.
    I'm using the following at the header level to tell the header not to show up if there are multiple shipment level addresses, but can't seem to get a similar statement to work when it's sitting at the same level as the group that I want to count.
    This is what I use at the header--it seems to work:
    <?if:count(xdoxslt:distinct_values(PLL_SHIP_ADDRESS_LINE1))>1?>See Details Below<?end if?><?if:count(xdoxslt:distinct_values(PLL_SHIP_ADDRESS_LINE1))=1?>
    POH_SHIP_ADDRESS_LINE1POH_SHIP_ADDRESS_LINE1
    POH_SHIP_ADDRESS_LINE2
    POH_SHIP_ADDRESS_LINE3
    POH_SHIP_ADR_INFO POH_SHIP_COUNTRY<?end if?>
    A really simplified version of the structure of the report is below:
    <?xml version="1.0" ?>
    - <!-- Generated by Oracle Reports version 10.1.2.0.2
    -->
    - <SMTPOXPRPOP2>
    - <LIST_G_INIT_INFO>
    - <G_INIT_INFO>
    <MANUAL_PO_NUM_TYPE>NUMERIC</MANUAL_PO_NUM_TYPE>
    <C_COMPANY>CompanyName</C_COMPANY>
    - <LIST_G_HEADERS>
    - <G_HEADERS>
    <POH_PO_NUM>310001100</POH_PO_NUM>
    - <LIST_G_LINES>
    - <G_LINES>
    <POL_VENDOR_PROD_NUM>12q</POL_VENDOR_PROD_NUM>
    <POL_ITEM_DESCRIPTION>sample</POL_ITEM_DESCRIPTION>
    <POL_QUANTITY_TO_PRINT>10</POL_QUANTITY_TO_PRINT>
    - <LIST_G_SHIPMENTS>
    - <G_SHIPMENTS>
    <PLL_SHIP_COUNTRY>Canada</PLL_SHIP_COUNTRY>
    <PLL_SHIP_ADR_INFO>Calg,AB Zip</PLL_SHIP_ADR_INFO>
    <PLL_SHIP_ADDRESS_LINE3 />
    <PLL_SHIP_ADDRESS_LINE2 />
    <PLL_SHIP_ADDRESS_LINE1>Ad1</PLL_SHIP_ADDRESS_LINE1>
    </G_SHIPMENTS>
    </G_SHIPMENTS> <PLL_SHIP_COUNTRY>Canada</PLL_SHIP_COUNTRY>
    <PLL_SHIP_ADR_INFO>Calg,AB Zip</PLL_SHIP_ADR_INFO>
    <PLL_SHIP_ADDRESS_LINE3 />
    <PLL_SHIP_ADDRESS_LINE2 />
    <PLL_SHIP_ADDRESS_LINE1>Ad1</PLL_SHIP_ADDRESS_LINE1>
    </G_SHIPMENTS>
    </G_LINES>
    <POH_SHIP_ADDRESS_LINE2 />
    <POH_SHIP_COUNTRY>Canada</POH_SHIP_COUNTRY>
    <POH_SHIP_ADR_INFO>Kanata,ON K2V 0A2</POH_SHIP_ADR_INFO>
    <POH_SHIP_ADDRESS_LINE3 />
    <POH_SHIP_ADDRESS_LINE1>XXX Palladium Drive</POH_SHIP_ADDRESS_LINE1>
    </G_HEADERS>
    </LIST_G_HEADERS>
    </SMTPOXPRPOP2>
    Could anyone help out with this?
    Thanks--I'd really appreciate it!
    Kate

    Hi Vetsrini--
    Thanks for getting back to me so quickly! I'd love to email you a copy and the XML if you wouldn't mind taking a look. it'll probably be more clear than me trying to explain.
    I can't quite figure out how to do that, though---your profile doesn't list an email. Do I need to click elsewhere?
    Thanks!
    Kate

  • Counting distinct values???

    Hi all,
    Why does this not work?
    "Select count(distinct employee_id) from employee_table"
    I am looking to return the count of the distinct employee_id.

    because its not valid SQL
    try:
    select * from employee_table where employee_id in (select distinct employee_id from employee_table)not very neat but should work (on oracle or SQLserveR)

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Second max/min in ssrs report builder expression

    I need to do conditional formatting on second max/min in an ssrs report builder table.
    Can i get it in an expression ?

    Hi AshishSinghal84,
    Based on my understanding, you want to perform conditional formatting on the second maximum or minimum value in Report Builder.
    In Reporting Services, there is no built-in function which can return second maximum value. So in this scenario, we can’t directly use expression to perform conditional formatting. However, we can get the second maximum or minimum on query level. Then insert
    a column into tablix and use Lookup function to return a specific value so that we can do the conditional formatting based on this value. As we test in our local environment, to perform conditional formatting such as change the color for second maximum value
    in Report Builder, we can follow the steps below:
    1.Add Dataset2, apply the query below:
    select max(sales)
    From test
    where sales < (select max(sales)
    from test)
    2.On report, add an Expression “=lookup(Fields!sales.Value,Fields!secondmax.Value,1,"DataSet2")”, looks like below:
    3.Click [month], Properties appears on the right panel. Find Color under Font tab, click Expression, then type “=IIF(ReportItems!Textbox6.Value=1,"red","black")”.
    4.Right click the third column, choose Column Visibility\Hide, click Ok.
    5.Final result looks like below:
    To perform conditional formatting on second minimum value, the steps are a little different from getting second maximum value. You should change the query at first step, then apply the query below:
    select min(sales)
    From test
    where sales > (select min(sales)
    from test)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • Record Count In report Builder

    Hi Folks,
    In Report Builder I want serial number with each record being fectched from the database in such a way that on each page of the report, the count should always start from 1. Any ideas?
    TIA
    Hassan

    Hi Hassan
    You may have a placeholder column or something and increment its value inside of a repeating frame format trigger.
    You may then reset its value to 1 in BETWEEN_PAGES trigger.
    Hope this helps.
    Regards
    Sripathy

  • Report Builder Count Column

    How can I build a count column with a where clause based on a query defined in the report builder query screen? From what I can tell the built in count column does not allow the addition or definition of a where clause.
    Thanks

    Hi Ruth,
    Not exactly sure if this will answer your question, but here goes. It sounds like you want to count values based on certain conditions? If the where clause is already in your query, you can use the count function that's available in SQL and allow the database to perform the count for you. Otherwise you can use a formula column in combination with a placeholder column or a summary column to get the conditional count. In the formula column you can use plsql to determine if you want to increment your count or not. Depending on how you do it, you can either just return '1' or '0' from your formula column and create a summary column based on your formula column. Or you can increment a placeholder column from your formula column. If you decide to go with placeholders, I'd suggest reading the online help examples for placeholders as there are a few rules you'll have to go by.
    Hope that helps,
    Toby

  • How to count distinct excluding a value in business layer?

    Hi all,
    I'm having a column which has many values. I need to make this is as a measure with count distinct aggregator. But i should not count 0 in the column. How can i do this. If i try to use any condition means the aggregator option is disables. Please help
    Thanks

    Look this example:
    I made in BMM in the SALES fact table measure:
    Count_Distinct_Prod_Id_Exclude_Prod_Id_144
    I'll count distinct PRODUCTS.PROD_ID, but exclude PROD_ID=144 in counting.
    Make this measure like this:
    1. New object/Logical column
    2. Go to data type tab and click EDIT on the logical table table source
    3. Now, in the general tab add join to a table (in my case PRODUCTS)
    4. Go to the column mapping tab -> show unmapped columns
    5. In the new column (in my case Count_Distinct_Prod_Id_Exclude_Prod_Id_144) write code like similar:
    CASE WHEN "orcl".""."SH"."PRODUCTS"."PROD_ID" = 144 THEN NULL ELSE "orcl".""."SH"."PRODUCTS"."PROD_ID" END
    6. Click OK and close the logical table source window
    7. Now, in the logical column window go to aggregation tab and choose COUNT DISTINCT.
    8. Move the measure Count_Distinct_Prod_Id_Exclude_Prod_Id_144 in the presentation area
    9. Test in Answers (report cointains columns as follow)
    PROD_CATEGORY_ID
    Count_Distinct_Prod_Id_Exclude_Prod_Id_144
    And the result in the NQQuery.log is:
    select T21473.PROD_CATEGORY_ID as c1,
    count(distinct case when T21473.PROD_ID = 144 then NULL else T21473.PROD_ID end ) as c2
    from
    PRODUCTS T21473
    group by T21473.PROD_CATEGORY_ID
    order by c1
    Regards
    Goran
    http://108obiee.blogspot.com

  • Report Builder Wizard and Parameter Creation with values from other data source e.g. data set or views for non-IT users or Business Analysts

    Hi,
    "Report Builder is a report authoring environment for business users who prefer to work in the Microsoft Office environment.
    You work with one report at a time. You can modify a published report directly from a report server. You can quickly build a report by adding items from the Report Part Gallery provided by report designers from your organization." - As mentioned
    on TechNet. 
    I wonder how a non-technical business analyst can use Report Builder 3 to create ad-hoc reports/analysis with list of parameters based on other data sets.
    Do they need to learn TSQL or how to add and link parameter in Report Builder? then How they can add parameter into a report. Not sure what i am missing from whole idea behind Report builder then?
    I have SQL Server 2012 STD and Report Builder 3.0  and want to train non-technical users to create reports as per their need without asking to IT department.
    Everything seems simple and working except parameters with list of values e.g. Sales year List, Sales Month List, Gender etc. etc.
    So how they can configure parameters based on Other data sets?
    Workaround in my mind is to create a report with most of columns and add most frequent parameters based on other data sets and then non-technical user modify that report according to their needs but that way its still restricting users to
    a set of defined reports?
    I want functionality like "Excel Power view parameters" into report builder which is driven from source data and which is only available Excel 2013 onward which most of people don't have yet.
    So how to use Report Builder. Any other thoughts or workaround or guide me the purpose of Report Builder, please let me know. 
    Many thanks and Kind Regards,
    For quick review of new features, try virtual labs: http://msdn.microsoft.com/en-us/aa570323

    Hi Asam,
    If we want to create a parameter depend on another dataset, we can additional create or add the dataset, embedded or shared, that has a query that contains query variables. Then use the option that “Get values from a
    query” to get available values. For more details, please see:http://msdn.microsoft.com/en-us/library/dd283107.aspx
    http://msdn.microsoft.com/en-us/library/dd220464.aspx
    As to the Report Builder features, we can refer to the following articles:http://technet.microsoft.com/en-us/library/hh213578.aspx
    http://technet.microsoft.com/en-us/library/hh965699.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Report Builder 2.0 loses parameter Null default value when deployed

    When a parameter is set to a default value of (Null) and the report is saved to the sever, the default is lost when the report is re-opened in RB2.  This problem doesn't seem to occur in BIDS.  I've tried to use an expression to set the value to System.DBNull but this can no longer be done.
    Any ideas for a work-around?
    Is there a bug report open for this?  I couldn't find an open bug on the Connections site and there's an issue on that site right now when submitting feedback.Paul Turley [Hitachi Consulting]
    SQLServerBIBlog.com

    Hi All,
    I just had an almost identical issue using report builder 3.0 so I don't believe it is fixed. I had 4 parameters set to default to (Null) and I added a new one with identical settings but it would continually come up blank and not check the null box automatically
    when going into my sub report.
    To make matters worse I experimented changing one of the old parameters and it then started exhibiting the same behaviour. Using Luke's post above solved the issue (though it was Manage in my version not Administrate).
    Using System.DBNull.Value resulted in it being treated as a literal string "System.DBNull.Value" and putting that in the filter for me.
    Hope it helps.

  • Showing column value as counter in sql query - report

    I created a classic report with search bar based on an sql query. I would like to show the "notes" column in this query using some sort of counter and as a hyperlink to another section on the page (same idea as footnotes in a book). So if I have 10 rows and 5 have "notes". I should show 1,2,3,4,5 in the notes column for those rows and the number gets displayed as a link to another section listing the notes 1 through 5.
    I was thinking of creating a hidden page item as the counter with value of 0 and then in my query doing counter+1 but i'm not sure how to do this or if i can do that...
    If anyone can help or have any other ideas I would really appreciate it!!
    Thanks,
    Hindy

    Well, I'm doing this in VB and the subquery is dynamic. I'm passing an ADO recordset to a routine that sets up a listview to display the results. The number of columns selected can vary. My idea was to size the columns appropriately based on the size of the data. Within the display routine I could:
    sql = "SELECT "
    for i = 0 to oRS.Fields.Count - 1
    sql = sql & "MAX(LENGTH(" & i & ")), "
    next 'i
    sql = sql & "FROM (" & oRS.Source & ")"

  • Formatting the Multi-Valued Parameter Selection in report builder 3.0

    Hi All,
    I have a field from a data set and i assigned it to a parameter that selects multiple values.
    But i want to format(i need only substring of that field value) the data set field value for the user to select those values.
    I build a report dataset model for my report. so I am getting the field values that are present in my database.
    So, how can i change those values before assigning them to the parameter?
    Regards,
    Ganga

    Hi Ganga,
    Based on your description, you want
    a parameter get values from a query but you need only substring of the field value. Right?
    In SQL Server Reporting Service, you could add a
    Calculated Field in the data set. Using expression to substring the field from query. Then we can use this calculated field in parameter.
    We have tested this scenario in our environment. Please refer to steps below:
    Right-click the data set in the Report Data window and select Add Calculated Fields.
    Click “Add” button to add a calculated field(Named “SubString”). Use text functions like Left() and Right() to substring data filed. Type in the expression like:=Left(Fields!CalendarYear.Value,1)+Right(Fields!CalendarYear.Value,2).
    The result is like below:
    If you have any more questions, please feel free to ask.
    Regards,
    Shrek Li

  • Report Builder 2.0 - Filtering multiple values with LIKE command

    Hi,
    I'm trying to use multiple values for a LIKE command in the Tablix Properties-Filters area. I thought this would be easy, and it may yet prove to be easy yet I'm banging my head against the wall at the moment.
    I have created a new filter with:
    Expression: Campaign
    Operator: Like
    Value: 02A*
    So, I only want the Campaign codes returned that start with 02A. Now, this on it own works fine, the issue begins when I want to add in the Campaigns beginning with 02K. I have tried adding a separate new filter underneath the first as well as using the
    OR command, yet, nothing is working correctly. When adding a separate filter it appears to work as an AND in conjunction with my first filter for 02A, but needs to work independently as an OR.
    Any help much appreciated.
    Mike

    Hi Mike,
    Based on my research, this should be a product issue in Report Builder 2.0. In your scenario, you should use “true” (without the quotes) to replace “True”. While changing True to true cannot work via UI since the UI will automatically change the true to
    True again. To work around this issue in Report Builder 2.0, you have to modify the True to true in the code view mode.
    After testing the issue in my environment again, I find another way to fix this issue. Please see:
    Expression: =(Fields!Campaign.Value like "02A*") OR (Fields!Campaign.Value like "02K*" )
    Type: Text or Boolean (Boolean type will automatically change to Text type)
    Operator: =
    Value: =true
    Btw, this issue has been fixed in Report Builder 3.0, the filter which you posted will be work great in Report Builder 3.0.
    If you have any other question, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Pie chart value not displaying in report builder

    Hi,
    I created a report by using report builder i used a pie chart in my report but one value is showing other one is not showing. Kindly tell me what is the problem behind it?
    here is an image which is not displaying 1 value in pie chart. please help me

    Hi Aamir,
    Please check if there is any misconfiguration (e.g. show data label, formatting, etc.) for your chart slice per the following post.
    http://social.technet.microsoft.com/Forums/en-US/ebc3bfc5-6338-4946-ade6-64e89611f6b7/ssrs-report-builder-30-pie-chart?forum=sqldatawarehousing
    http://msdn.microsoft.com/en-us/library/dd220469.aspx
    Further more, you can post this topic in SQL server forum for a better assistance.
    http://social.technet.microsoft.com/Forums/en-US/home?forum=sqlreportingservices%2Csqldatawarehousing%2Csqlanalysisservices&filter=alltypes&sort=lastpostdesc
    Thanks
    Daniel Yang
    TechNet Community Support

Maybe you are looking for

  • New DVD burner not working w/iTunes

    Okay, I've been working on this and digging through these forums for awhile now. I'm still stumped. So here we go: I had a new DVD burner installed. I'm using Nero software which works fine for DVD, data, etc. However, iTunes gives me the "disc burne

  • After a recent update I cannot print to my wireless printer

    I cannot AirPrint from my iPad after a recent update. Any suggestions?

  • Why is Xcode4 adding chars?

    I have enough chars to contend with without having Xcode4 add any extras for me. Here's the deal. These little snippet's cost me a bit of time. I created a test window app and: In my @interface file I have the following: === @interface HyposisterAppD

  • How to configure end user for CallManager 5.1

    Hello everyboy I am trying to configure the end user to have access to callmanager, because I want the people can configure the speed dial, I know that release 4.2 you just configure the user/password and the peple can log in to http://<ip_address>/c

  • Problem with Update Script

    I am trying to Update a column in the Database with the Following script, but am still getting errors on ORA-00904: "CUSTOMER_CONTACT_NRD"."ACTIVE": invalid identifier, even thought this should be right. In the end I want to update the whole table li