Counting Records by Age Category

Hi - need some help with the following usiing BO XI Web.
I am trying to form 6 or 7 categories for records that are >= 0 Days old, >= 30 Days old, >= 60 Days old, >= 90 Days old, >= 120 Days old, >= 180 Days old, >= 360 Days old.
I have a field called, V_Days Since that counts how old a record is.
My ultimate goal is to form a cross table to show, how many opportunities are X days old by category
How would I do that? I will also try this category counting for the size of the opportunity (larger than 1 M USD, larger than 5 M USD etc)
I have tried to count the opportunity ID for every record that is older than....
I am having a bit of trouble with the code, so any help is much appreciated. Thank you very much!!!

Hi CRizzle,
You could create a variable for each category, for instance for \[30 Days Back\]:
=RelativeDate(CurrentDate(),-30)
For \[60 days back\]:
=RelativeDate(CurrentDate(),-60)
and so on.
Then you would compare your date to each date variable in a formula on the report, or another variable, like:
=If [Your Date]>= [30 Days Back] then [Date]
or you could make it \[30 Day Flag\]:
=If [Your Date]>= [30 Days Back] then 1 else 0
Then you could use that in a formula with your opportunity dimension:
[Opportunity Dim] where ([30 Day Flag] = 1)
Thanks

Similar Messages

  • Counting records in Visual Composer

    Hi folks,
    I do have question I cannot find a solution ( maybe due to christmas turkey paralysis )
    I am using VC to call a RFC function in ERP system 'RFC_READ_TABLE' to access data from table.
    The table I access is a customer table containing Delta- Data
    Actually the system RFC function returns all records ( normally between 1 and 10 records).
    On VC side I'd like to display only the number of records to inform if new data is available.
    How can I count records internally in VC?
    ( I do not like to bring in data directly into BI because the application I write will merge BI Query data with non BI data)
    I'D like to use standard RFC function to receive data, but first hand I'd like to decide by number of entries whether to use data or not.
    Any help is appreciated
    TIA

    Hi Prachi,
    that's it.
    I never used that functionality for plain counting records being returned by tables
    It woks perfect.
    The glory shiny points are yours.
    Joerg

  • How to count records from 2 tables and show in RDLC Report

    hi all,
    its being a one day searching for the solution but No Luck.
     I have two SQL tables tblstudetail and tblfeereceiptdetail.
    i just want to count records from both tables and show in RDLC report.
    I tried SQl Query Like This:
    select a.session, a.course,
    Count(CASE a.ADstatus WHEN 'OK' THEN 1 ELSE 0 END ) AS Admission,
    Count(CASE s .I_receiptstatus WHEN 'OK' THEN 1 ELSE 0 END) AS Feeprint
    from
    tblstudetail a
    FULL join
    tblfeereceiptdetail s on s.studentID = a.studentID
    where a.session = '2015' AND s.Fsession = '2015' AND a.adcat = 'Regular'
    GROUP BY a.session,a.course
    ORDER by a.course
    The result Show the Same Value in Both columns
    Session    Course      Admission       FeeDetail
    2015          B.A. I               275              275
    2015          B.A. II              307             307
    2015         B.A. III             255            255
    2015          B.Sc. I             110             110
    2015           B.Sc. II           105            105
    2015          B.Sc. III            64               64
    Actully I want to Count How many ADMISSION have been Taken(FROM tblstudetail) and How many FEE RECEIPT have been Print (From tblfeereceiptdetail).
    please guide me for this as soon as possible.
    thanks in advance...

    I am counting 'OK' in both the table columns I.e 'ADstatus' in tblstudetail and 'feereceiptstatus' in tblfeereceiptdetail
    please suggest me

  • Counting records in crosstab report

    I am very new to the reporting world so apologies if this seems so simple.
    I am trying to understand how count records that meet certain criteria and I am at a loss as to how to make it work (Crystal Reports 2008)
    I am setting up a cross tab report where I am want to count records that vwSubscription.status="Active" AND vwSubscription.isDues=True
    I think I should be creating a Formula Field that tests the status and dues record and when they both meet the correct criteria then have the Formula Field in the Summarized field of the Cross Tab Expert...
    make sense? please help

    Yes. You should create a formula like this
    IF vwSubscription.status="Active" AND vwSubscription.isDues=True THEN
    1
    And in Cross tab Create A Sum  of this field under Summary fields.
    If you want this value to be displayed based on some group, cross tab will be a good option, else you can create a sum of this field and place it in Report header to get the total.
    HTH,
    Jyothi

  • How to count records in a page which are in detail section

    Hi
    Is there a option to count records in detail section and so that based on that can apply a formula.

    Hi
    can i place the below two formulas in section experpt ?
    my report is like
    gh#1 
    details-----which contains transactions related to above group for a country
    group footer#1contains line '--
    if for india there are 3 records in the same page there can be 2 or 3 records in detail section. like that a page can contain more than one country. if number of records are more and coming in next page then the whole section should be moved to new page.
    that is my req. can u suggest accordingly.....
    i want to count the number of records in detais which will vary also how can i put formula when they are going to next page?

  • Mysql database, counting records

    Hi!
    I have to store measured data to MySQL database. During this process I would like to count a number of records in a database table. It is also necessary to filter records. I'm using the SQL statement as follows:
    SELECT COUNT (fieldname) AS cnt FROM table WHERE condition
    Because I haven't got any result I've created a small database "mysweetdb" and table "icecream" to test my VIs (see picture bellow).
    The VI is attached. The result of counting is a 2D array (DB Tools Fetch Recordset Data.VI output) with one element (one row and one column). This element contains no data.
    I usually don't give up easily so I've created a similar MS ACCESS database and counted data in it. I've got a correct answer: 3. So it might be possible that there is something wrong with MySQL driver. But I've created a small Delphi project and I've counted records in MySQL database and MS ACCESS database. Both results were correct.
    Can anyone explain where is the problem in communication between LabView and MySQL database?
    Versions: XAMPP for Windows 1.7.3, LabView Developer Suite 2010 SP1, MySQL 5.1 ODBC driver
    Thanks in advance for your suggestions.
    Attachments:
    Count records.vi ‏19 KB

    ContDivConsult,
    thank you for your answer. An updated version of my VI is attached. It uses two options: LabSQL library and DB Connectivity Toolkit. LabSQL gives correct results.
    Regards,
    Ljubo.
    Attachments:
    Count records.vi ‏25 KB

  • Error: The sort order specified for distinct count records is incorrect

    When processing a measure group with a distinct count measure in it, i get the following error:
    "The sort order specified for distinct count records is incorrect."
    I have no idea what this means - any ideas?

    I had the same problem and your fix worked.  In more detail, the problematic field was contract_no.  I added a named calculation to the table in the Data Source View with the formula CHECKSUM(contract_no).  Then I created the distinct count measure on that named calculation.  And, lo and behold, the errors disappeared! 
    Thank you to Frank.
     - CindyCindy P Hoskey

  • COUNTING RECORDS AND DETERMINING AVERAGES IN REPORT WRITER

    I HAVE 10 GROUPS. I WANT TO BE ABLE TO COUNT RECORDS AND DETERMINE THE AVERAGE DAYS FOR EACH GROUP. I GET DAYS BY SUBTRACTING THE RECEIVED DATE FROM THE RESULT DATE. I WANT TO DETERMINE THE AVERAGE DAYS AND THE NUMBER OF RECORDS IN THE TOP 10%, THE TOP 20%, THE TOP 30%, THE TOP 40%, THE TOP 50%, THE TOP 60%, THE TOP 70%, THE TOP 80%, THE TOP 90%, AND THE TOP 100%. HOW DO I CODE MY LOOP IN PLSQL TO DO THIS? CAN I DO THIS IN REPORT WRITER?

    I am not sure about the exact thing that you are requiring. but you can get the top 100 and top 20 or top 300 etc. by using the ROWNUM function in sql statement.
    thanks

  • Leaf Count Record

    After backing up my hard drive and booting from my freshly made eDrive, I ran TechTool Pro 6's "Volume Rebuild" and after that ran it showed me the results, as usual. There were a few green items but one red. The "Leaf Count Record" went from 1777 to 625. I tried to find out what a Leaf Count Record is by googling it but only count find things on the error associated with this.
    So my first question is: What is a Leaf Count Record?
    Secondly, is there any problem with my Leaf Count going down, and should i be worried about it?
    Note: i went ahead with the rebuild since all the information i could find on Leaf Count Record is mostly about the Leaf Count going up and not down.

    After backing up my hard drive and booting from my freshly made eDrive, I ran TechTool Pro 6's "Volume Rebuild" and after that ran it showed me the results, as usual. There were a few green items but one red. The "Leaf Count Record" went from 1777 to 625. I tried to find out what a Leaf Count Record is by googling it but only count find things on the error associated with this.
    So my first question is: What is a Leaf Count Record?
    Secondly, is there any problem with my Leaf Count going down, and should i be worried about it?
    Note: i went ahead with the rebuild since all the information i could find on Leaf Count Record is mostly about the Leaf Count going up and not down.

  • Invalid Leaf Count Record

    When I repaired my startup disk with Disk Utility, an invalid leaf count record error was reported. From looking at other posts, it appears that one of the recommended things to do for this is trying to repair the issue with Disk Utility. I tried this using Disk Utility 4.1. I replaced my directory with the rebuilt directory. Unfortunately, when I started back up from my install CD and ran Repair Disk, the invalid leaf count record error was reported again.
    Any advice would be much appreciated... maybe I did something wrong.
    Thanks

    First, I realized that I had the error message wrong. I should have wrote "Invalid Leaf Record Count" originally instead of "Invalid Leaf Count Record". I doubt this makes a difference, but just in case there it is.
    Secondly, I am running 10.3.9 and have been doing so for quite some time. My understanding based on this is that DiskWarrior 4.1 should work. I took your advice and tried running DiskWarrior again. As I did previously, I simply booted from DiskWarrior because the disk I am trying to fix is my startup disk. I rebuilt and replaced the directory with DiskWarrior 4.1 again. As a matter of fact, I ran it multiple times while I had it going. I even ran it under the scavenge mode.
    After doing this, I restarted the computer, ejected the DiskWarrior disc, and put in my install disc that came with my iMac. I booted from this CD and reran "Repair Disk" with Disk Utility. The error stills shows up. One thing to note is that my install disc came with 10.3.5 on it. Could this somehow cause a problem? My understanding is that you should always use an install disc for the major OS version you are running to run the "Repair Disk" function of Disk Utility. For example use an install disc for 10.3 if you are trying to repair a disk running 10.3.x or use an install disc for 10.4 if you are trying to repair a disk running 10.4.x.
    Prior to ever running DiskWarrior, I used the fsck command from single-user mode. Interestingly, the error did not show up here. I thought the "Repair Disk" function with Disk Utility was similar to this command, but maybe there is enough variation to cause the difference. Do you guys have any idea, which one I should trust?
    Let me know if any of this is incorrect. Any other suggestions regarding this error would be welcomed. I don't really understand what the error itself means. For now, I guess I will just leave it since I don't really know what else to do. Maybe in the future it will get worse and DiskWarrior will recognize it... I know that's asking for a problem!

  • Count records based on detail row containing a null date field

    i need to count the no of rows where a date field is null and print the result in each group footer. the formula isnull works well in details section  but not when I create a running total to count records where evaluate condition is based on a formula and when i test isnull(field) ?
    works in detail section:
    Global NumberVar numOpen;
    if (IsNull({db.DateField}))
    then numOpen := numOpen + 1;
    does not work in group footer?
    IsNull({db.DateField})

    Abhilash Kumar wrote:
    Well, what database are you reporting off and how did you insert a NULL value to the date column?
    In my case, I have worked with Oracle, Access, and now SQL.,
    and have used several different versions of Crysal (but never XI)
    I/we don't put anything into the date...  the field is simply empty and I use 
    IsNull({datefield})
    also for numbers (&currency)
    IsNull({numberfield})
    For text fields I now use
    IsNull({textfield}) or {textfield} not equal ""
    as SQL is a little funny about the empty text fields. Sometimes one works and sometimes the other so I use both.
    Debi

  • Interactive Reporting - Counting Records in a Non-numeric Column

    I have created a report that shows open trouble tickets, the group they are assigned to and the status of the ticket. I would like to create another report based on the first one that shows each group and the number of tickets they have in each status category. For example:
    Group Assigned Testing Closed Total
    Bus. Analysts 2 5 0 7
    I.T. 6 2 3 11
    Is there a function in IR that can count number of rows/records?

    depending on how you have your data you can use a Pivot section.
    If the data is 1 row = 1 record then add computed column to your results with a static value of 1 and use that as your fact within the pivot with your Ticket Type as a top label and group as a side label.
    Wayne Van Sluys
    TopDown Consulting

  • Oracle DB 10g - Count records from a subquery is to slow. (after tuning)

    Hi everybody:
    I have the following problem.
    1.- I have a transactional table with 11 millions of records.
    2.- The user asked for a few reports, to know some sumarized data for business decisions.
    3.- Initialy the query was developed in a development environment, with a subset smaller than the actual data mentioned in label 1.
    4.- When the report was delivered to the end user, the report never return data.
    5.- at this point, we performed tuning, adding indexes, re-writing the query, using hints, etc. and the following scenario is ocurring:
    a) the query without the count, before the tuning was taking about 3 to 5 minutes, and returned aproximatelly 332,000 records-.
    b) the numer of records was counted and this query takes aproximatelly 15 to 23 minutes.
    c) after the tuning, the raw data, returns in 1 second, we used some b-tree indexes, some FBI (because the report needs to filter by to_char functions).
    that time is ok for us, 1 second is a great time in comparison with the 3 to five minutes.
    d) the funny thing, is that when we add a simple count(1), count(x) or wathever flavor of count, the count takes about 3 minutes to return, with the 332,00
    records. is better than de 15 minutes of course, but we dont need count(1), we need to use group by, order by, etc, and will increase the time of query.
    6.- Another thing is happening, if I use count(1) with a transactional table with 600,000 records, without filtering, the count returns in les than 2 seconds. Even if the data is more than the result of my query defined in label 5.c, and that query returns in 1 second.
    Please help me with this, I know that maybe is something that i'm not considering on tuning. Or if there is a way to run this count query faster, please let me know.
    This is the query:
    WITH historial_depurado_v AS (
    select serie, identificador,
           cc_form_cc_tifo_tipo_forma
          ,cc_form_serie
          ,cc_form_folio
          ,estatus_nuevo
          ,to_char(fecha,'MM') Mes
          ,to_char(fecha,'YYYY') Anio  -- the table has a FBI for this.
          ,get_recaudacion_x_forma (hifo.CC_FORM_CC_TIFO_TIPO_FORMA
                                   ,hifo.CC_FORM_SERIE
                                   ,hifo.CC_FORM_FOLIO) Recaudacion  -- function for description.
    from  cc_historial_formas hifo
    where not exists (select 1
                         from ve_tipos_placas tipl
                        where tipl.cc_tifo_tipo_forma = hifo.cc_form_cc_tifo_tipo_forma)
    SELECT serie
      FROM historial_depurado_v hide
    WHERE Anio = '2009'  -- using the function based index.
       AND Mes = '01'
       AND Estatus_nuevo = 'UT'
    -- returns in 1 second, but if I use count(serie) takes 3 to 5 minutes, and still is not complete, I need to use group by some fields returned by the firs subset.
    -- if I count a table with more records, returns in 2 seconds.

    alopez wrote:
    WHERE Anio = '2009'  -- using the function based index.
    AND Mes = '01'
    AND Estatus_nuevo = 'UT'
    Also, i'm not sure if your internal comment is correct, but if you have a function based index on any of those columns, it will ONLY work when you apply the exact function as defined in the FBI (you aren't using any functions on ANY of your columns).
    An example.
    create table use_the_fbi
       column1  date
    insert into use_the_fbi
    select
       trunc(sysdate, 'dd') - level
    from dual connect by level <= 10000;
    create index use_the_fbi_FBI on use_the_fbi (to_char(column1, 'YYYYMM') );
    exec dbms_stats.gather_table_stats( user, 'USE_THE_FBI', cascade=> true, method_opt=> 'for all hidden columns');Let's try without querying in the manner in which we defined the index.
    explain plan for
    select *
    from use_the_fbi
      4  where column1 = '201006';
    Explained.
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?@xplain
    PLAN_TABLE_OUTPUT
    Plan hash value: 1722805582
    | Id  | Operation         | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |             |   100 |   900 |     7   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| USE_THE_FBI |   100 |   900 |     7   (0)| 00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1 / USE_THE_FBI@SEL$1
    Predicate Information (identified by operation id):
       1 - filter("COLUMN1"='201006')
    Column Projection Information (identified by operation id):
       1 - "COLUMN1"[DATE,7]
    23 rows selected.
    Elapsed: 00:00:00.02Sad Christmas .. no index love.
    Now, query as we defined the index
    explain plan for
    select *
    from use_the_fbi
    where to_char(column1, 'YYYYMM') = '201006';
    Explained.
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?TUBBY_TUBBZ?@xplain
    PLAN_TABLE_OUTPUT
    Plan hash value: 268331390
    | Id  | Operation                   | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                 |    30 |   450 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| USE_THE_FBI     |    30 |   450 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | USE_THE_FBI_FBI |    30 |       |     1   (0)| 00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1 / USE_THE_FBI@SEL$1
       2 - SEL$1 / USE_THE_FBI@SEL$1
    Predicate Information (identified by operation id):
       2 - access(TO_CHAR(INTERNAL_FUNCTION("COLUMN1"),'YYYYMM')='201006')
    Column Projection Information (identified by operation id):
       1 - "USE_THE_FBI"."COLUMN1"[DATE,7]
       2 - "USE_THE_FBI".ROWID[ROWID,10], TO_CHAR(INTERNAL_FUNCTION("COLUMN1"),'YYYYMM')[VA
           RCHAR2,6]
    27 rows selected.
    Elapsed: 00:00:00.03
    TUBBY_TUBBZ?Happy times.

  • Counting records in a query

    Hello all,
    I have a question about the counting of records in a query.
    Below, there is the source data.
    material plant date stock quantity
    X 1 05.2006 10
    X 1 06.2006 0
    X 2 05.2006 15
    X 2 04.2006 20
    Y 1 05.2006 5
    And with "How to Count the occurrences ..." guide , i created the following query.
    material quantity number of plants with stock
    X 45 2
    Y 5 1
    My question is in the second step , is it possible in the same query to get the following result for a given date ?
    If this is not the case, how can I resolve this ?
    material quantity nb of plants with stck nb of plants with stck >= 15
    X 45 2 1 (10 for 1 and 35 for 2)
    Y 5 1 0
    Thanks&Regards
    Burak

    Create a display item to hold the count value. Then open the data block properties and under advanced database set precompute summaries to "yes". Then in your display item properties set the summary function to count; the summarized block to the block_name; and summarized item to any block item you would like to count.
    Hope this is clear and what you are looking for.
    Cheers.

  • How to count records in table and send email only if count 0

    I thought this would be fairly simple, but apparently not.  I'm trying to count the number of records I have in my staging table, and send an email if count > 0  . . . .  and . . . . I want to put the count in the body of the email. 
    I'm running into a problem with the concatenation part of it.
    SET NOCOUNT ON
    SELECT * FROM [dbo].[Staging]
    SELECT @@rowcount as Row_Count
    SET NOCOUNT OFF
    IF @@rowcount > 0
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    The problem comes from the '+' character not being recognized.  Maybe it's out of scope, not sure.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Try this
    SET NOCOUNT ON
    IF EXISTS (SELECT TOP 1 1 FROM [dbo].[Staging])
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    Thanks
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Maybe you are looking for

  • Issue after Java Addin Successfull Installation-- com.sap.engine.services.d

    com.sap.engine.services.deploy.container.ExceptionInfo: Naming error. Hi All, Please help me to fix the following issue: After Successfull installation of Java Addin to ECC 6.0 (SR3,Oracle 10.2,Solaris 5.10) i am facing the following issue when i try

  • HT3231 How do I change the password on a MacBook Pro that I bought secondhand??

    My MacBook Pro keeps asking to update software, eg: Flash Player, and I can't install it because I don't have the User Password. I bought the laptop secondhand from an Auction – the company that it belonged too has gone bust. I also own an iMac 27" (

  • Solaris hangs after reboot on HP DL160

    Hi, my HP DL160 runs fine with Solaris 10, but you can't do a soft reboot, because it won't boot Solaris after that (hangs after loading kernel). I think it's because of a ATA Bug, but nothing has helped to solve the problem (done the ata-revert-to-d

  • Issue with IMAP accounts - cannot delete

    I am running the latest OS on iPhone 4. I recently had some issues with my email accounts and had to delete them all from my iPhone, then recreate them. I thought they were originally set up as POP emails, but as I could see all my online folders, I

  • ITunes 11.4 hangs way too often on Win7 64b. What is up?

    For the last couple of versions, iTunes hangs on me several times a day. I have exhausted all the remedies I can find, including "repair" on the iTunes install. Any clues?