Count of total childeren from hierarchy

Hi all
I have a date hierarchy as followed :
2010
2011
2012
2012 Jan
W01
W02
W03
W04
2012 Feb
2012 March
In my dataset I'm outputing the results for each month.
January  ...
February ...
I want to add a column in my dataset that counts the amount of weeks in each month. Sometimes this is 4, sometimes 5 ...
How can I do this? I tried
MEMBER [Measures].[Test] AS
COUNT(DESCENDANTS([Draw].[Draw calendar invoice - Month].[Invoice month of year].CurrentMember,, AFTER))
or COUNT([Draw].[Draw calendar invoice - Month].[Invoice month of year].CurrentMember.childerne) but nothing works.
Any suggestions?
 Thanks!

If you have the proper attribute relationship setup like Date->Week->Month->Year, Then this should fetch you the answer,
WITH
MEMBER [Measures].[X] AS
[Date].[Calendar].CurrentMember.Children.Count
SELECT
[Measures].[X] ON 0
,[Date].[Calendar].[Month].MEMBERS ON 1
FROM [Analysis];
Be the change you want.

Similar Messages

  • Pagination Displaying Count of Total Records available and Current Page

    Hi,
    I need to implement paging in one of our pages.
    The problem is we need to display the count of total number of records the search has resulted and the search results that fall into the current page.
    For e.g. If the search resulted in 100 records total and we are in page 5 (with 10 records per page), I need to display the count 100 on the top and records 51-50 in the page.
    How to get the count of fetched results without running a second SELECT COUNT(1) FROM ... clause.
    Is there a way to do this in a optimized way?
    Thanks

    How to get the count of fetched results without running a second SELECT COUNT(1) FROM ... clause.
    SQL> select cnt "Total", rn "Line", empno, ename, job
      from (select count (*) over () cnt, row_number () over (order by empno) rn,
                   empno, ename, job
              from emp)
    where rn between 4 and 6
         Total       Line      EMPNO ENAME      JOB     
            14          4       7566 JONES      MANAGER 
            14          5       7654 MARTIN     SALESMAN
            14          6       7698 BLAKE      MANAGER 

  • Populating Account field with totaled number from Activities.

    All-
    Got a curious one.
    We're using activities to count up the numbers from various site visits. What we want to do is have the number just populate automatically on the account record. So, whenever a new activity is saved, or an older one is updated. We want that number to update on the account. Is this a workflow thing? a Joinfieldvalue function thing? Both together using the Account ID to tie them together.
    So, on the activity record, there are various number fields for different value. But we're also having a total field that adds it all up. We want that field plus all the other total fields for activities attached to this account to be added up and place on the account record in a custom field.
    Any suggestions would be much appreciated.

    I think you may be right. I did some research and came up with this.
    Use query builder and default values to populate Activity records with information from the associated Account record. Then the User would enter any new values on the Activity, and, upon saving, a web service would be triggered to populate the revisions back to the Account record. This way, the Account record would always have the most current values, and the next time they have an activity, the activity would be populated with the most current values.
    We can’t go from the Activity to the Account. That’s why it needs to be the web service for this portion. There needs to be a one-to-one relationship defined, and on one Activity record you can define one Account that is related to it. But it doesn’t work the other way, because an Account can have multiple activities and there’s no way to define “THE” activity.
    Does that sound right?

  • Counting Record Totals Within Query: Totals Output to New Table

    Hi All,
    I'm failry new to PL/SQL... my apologies if this is obvious... I'm trying to count the total number of BI_WRKFLW.BI_LMN_SRV_AREA occurences by each BI_WRKFLW.BI_LMN_SRV_AREA (The Code correspondes to a city name like Sundance, Sheridan, Etc.)
    So, I have a Query that executes fine:
    Query
    /* Begin Querey */
                    SELECT DISTINCT
                        "BI_SO_DET_VIEW_1"."BI_SO_STAT_CD",
                        "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED",
                        "BI_TYPE_SERVICE"."BI_ACCT",
                        "BI_SO_DET_VIEW_1"."BI_SO_NBR",
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_DESC",
                        "BI_SO_TYPE_REF"."BI_SO_TYPE_DESC",
                        "BI_SRV_STAT_REF"."BI_SRV_STAT_DESC",
                        "BI_DIST_OFC_REF"."BI_DIST_NAME",
                        "BI_CNTY_REF"."BI_COUNTY_DESC",
                        "BI_SO_DET_VIEW_1"."BI_CLOSE_DT",
                        "BI_WRKFLW_TASKS"."BI_EVENT_DT_TM",
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD",
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_AREA",
                        "BI_SO_MASTER"."BI_WO_WORKORD"
                    FROM
                        ((((((((("XXXXXX"."BI_SO_MASTER" "BI_SO_MASTER"
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SO_DET_VIEW_1" "BI_SO_DET_VIEW_1"
                    ON
                        "BI_SO_MASTER"."BI_SO_NBR"="BI_SO_DET_VIEW_1"."BI_SO_NBR")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_TYPE_SERVICE" "BI_TYPE_SERVICE"
                    ON
                        "BI_SO_DET_VIEW_1"."ACCT_NBR"="BI_TYPE_SERVICE"."BI_ACCT")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_WRKFLW" "BI_WRKFLW"
                    ON
                        "BI_SO_DET_VIEW_1"."BI_WRKFLW_KEY"="BI_WRKFLW"."BI_WRKFLW_KEY")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SO_TYPE_REF" "BI_SO_TYPE_REF"
                    ON
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"="BI_SO_TYPE_REF"."BI_SO_TYPE_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_WRKFLW_TASKS" "BI_WRKFLW_TASKS"
                    ON
                            "BI_WRKFLW"."BI_WRKFLW_KEY"="BI_WRKFLW_TASKS"."BI_WRKFLW_KEY")
                    AND (
                            "BI_WRKFLW"."BI_WORK_EVENT_CD"="BI_WRKFLW_TASKS"."BI_WORK_EVENT_CD"))
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_DIST_OFC_REF" "BI_DIST_OFC_REF"
                    ON
                        "BI_WRKFLW"."BI_DIST_OFC_CD"="BI_DIST_OFC_REF"."BI_DIST_OFC_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_LMN_SRV_REF" "BI_LMN_SRV_REF"
                    ON
                        "BI_WRKFLW"."BI_LMN_SRV_AREA"="BI_LMN_SRV_REF"."BI_LMN_SRV_AREA")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SRV_LOC" "BI_SRV_LOC"
                    ON
                        "BI_TYPE_SERVICE"."BI_SRV_LOC_NBR"="BI_SRV_LOC"."BI_SRV_LOC_NBR")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SRV_STAT_REF" "BI_SRV_STAT_REF"
                    ON
                        "BI_TYPE_SERVICE"."BI_SRV_STAT_CD"="BI_SRV_STAT_REF"."BI_SRV_STAT_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_CNTY_REF" "BI_CNTY_REF"
                    ON
                        "BI_SRV_LOC"."BI_CNTY_CD"="BI_CNTY_REF"."BI_CNTY_CD"
                    WHERE
                            "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='010'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='010NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='011'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='011NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='020'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='020NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='030'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='040'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='041'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='050'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='050A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='051'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='051A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='080'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='085'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='085NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='108'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='140'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='141'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='400'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='401'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='450'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='450A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='451'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='451A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='452'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='452A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='453'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='453A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='460'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='RHR'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='RHRNS')
                    AND "BI_SO_DET_VIEW_1"."BI_SO_STAT_CD"='O'
                    AND (
                            "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='ANNEXATION'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='AVIAN'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CAPVERIF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CBMRETIRE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CBMSERVCHG'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CONTSERVD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CUSTBLD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CUTOFF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='DVCM'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='ENERGIZE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='EQUIPCHANG'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='EQUIPVALID'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='HIGHLOAD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='LOCATE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='MAINT-EQ'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='MSYSTEMMGT'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NCBM'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NEWRES-WF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NEW-WF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='POWER QUAL'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RECONIDLE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RECVERIF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RETIRE1'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RETIRE2'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SERVCHANGE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SPECIALPRJ'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SUBD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SYSTEMMGT'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='TREE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='TRFX')
                    ORDER BY
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_DESC" DESC,
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"
                        /* End Querey */That is wrapped within a counting Block that is giving me trouble:
    SELECT
        WOCOUNT.Office,
        WOCOUNT.WOCOUNT
    FROM
            SELECT
                CASE
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '1'
                    THEN '1-SUNDANCE'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '2'
                    THEN '2-GILLETTE'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '3'
                    THEN '3-SHERIDAN'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '4'
                    THEN '4-West/Central'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '5'
                    THEN '5-East/Central'
                    ELSE '0-OTHER'
                END                                AS Office,
                COUNT (T1.BI_LMN_SRV_AREA ) AS WOCOUNT
            FROM
                    /* Begin Querey */
                    /* End Querey */
                ) T2
            JOIN
                BI_SO_DET_VIEW_1
            ON
                T2.BI_WRKFLW_KEY = BI_SO_DET_VIEW_1.BI_WRKFLW_KEY
            GROUP BY
                BI_WRKFLW.BI_LMN_SRV_AREA
                 )WOCOUNTThis is the 2 blocks together:
    SELECT
        WOCOUNT.Office,
        WOCOUNT.WOCOUNT
    FROM
            SELECT
                CASE
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '1'
                    THEN '1-SUNDANCE'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '2'
                    THEN '2-GILLETTE'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '3'
                    THEN '3-SHERIDAN'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '4'
                    THEN '4-West/Central'
                    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '5'
                    THEN '5-East/Central'
                    ELSE '0-OTHER'
                END                                AS Office,
                COUNT (T1.BI_LMN_SRV_AREA ) AS WOCOUNT
            FROM
                    /* Begin Querey */
                    SELECT DISTINCT
                        "BI_SO_DET_VIEW_1"."BI_SO_STAT_CD",
                        "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED",
                        "BI_TYPE_SERVICE"."BI_ACCT",
                        "BI_SO_DET_VIEW_1"."BI_SO_NBR",
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_DESC",
                        "BI_SO_TYPE_REF"."BI_SO_TYPE_DESC",
                        "BI_SRV_STAT_REF"."BI_SRV_STAT_DESC",
                        "BI_DIST_OFC_REF"."BI_DIST_NAME",
                        "BI_CNTY_REF"."BI_COUNTY_DESC",
                        "BI_SO_DET_VIEW_1"."BI_CLOSE_DT",
                        "BI_WRKFLW_TASKS"."BI_EVENT_DT_TM",
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD",
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_AREA",
                        "BI_SO_MASTER"."BI_WO_WORKORD"
                    FROM
                        ((((((((("XXXXXX"."BI_SO_MASTER" "BI_SO_MASTER"
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SO_DET_VIEW_1" "BI_SO_DET_VIEW_1"
                    ON
                        "BI_SO_MASTER"."BI_SO_NBR"="BI_SO_DET_VIEW_1"."BI_SO_NBR")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_TYPE_SERVICE" "BI_TYPE_SERVICE"
                    ON
                        "BI_SO_DET_VIEW_1"."ACCT_NBR"="BI_TYPE_SERVICE"."BI_ACCT")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_WRKFLW" "BI_WRKFLW"
                    ON
                        "BI_SO_DET_VIEW_1"."BI_WRKFLW_KEY"="BI_WRKFLW"."BI_WRKFLW_KEY")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SO_TYPE_REF" "BI_SO_TYPE_REF"
                    ON
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"="BI_SO_TYPE_REF"."BI_SO_TYPE_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_WRKFLW_TASKS" "BI_WRKFLW_TASKS"
                    ON
                            "BI_WRKFLW"."BI_WRKFLW_KEY"="BI_WRKFLW_TASKS"."BI_WRKFLW_KEY")
                    AND (
                            "BI_WRKFLW"."BI_WORK_EVENT_CD"="BI_WRKFLW_TASKS"."BI_WORK_EVENT_CD"))
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_DIST_OFC_REF" "BI_DIST_OFC_REF"
                    ON
                        "BI_WRKFLW"."BI_DIST_OFC_CD"="BI_DIST_OFC_REF"."BI_DIST_OFC_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_LMN_SRV_REF" "BI_LMN_SRV_REF"
                    ON
                        "BI_WRKFLW"."BI_LMN_SRV_AREA"="BI_LMN_SRV_REF"."BI_LMN_SRV_AREA")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SRV_LOC" "BI_SRV_LOC"
                    ON
                        "BI_TYPE_SERVICE"."BI_SRV_LOC_NBR"="BI_SRV_LOC"."BI_SRV_LOC_NBR")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_SRV_STAT_REF" "BI_SRV_STAT_REF"
                    ON
                        "BI_TYPE_SERVICE"."BI_SRV_STAT_CD"="BI_SRV_STAT_REF"."BI_SRV_STAT_CD")
                    LEFT OUTER JOIN
                        "XXXXXX"."BI_CNTY_REF" "BI_CNTY_REF"
                    ON
                        "BI_SRV_LOC"."BI_CNTY_CD"="BI_CNTY_REF"."BI_CNTY_CD"
                    WHERE
                            "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='010'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='010NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='011'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='011NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='020'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='020NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='030'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='040'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='041'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='050'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='050A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='051'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='051A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='080'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='085'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='085NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='108'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='140'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='141'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='400'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='401'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='450'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='450A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='451'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='451A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='452'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='452A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='453'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='453A'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='460'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='RHR'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='RHRNS')
                    AND "BI_SO_DET_VIEW_1"."BI_SO_STAT_CD"='O'
                    AND (
                            "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='ANNEXATION'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='AVIAN'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CAPVERIF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CBMRETIRE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CBMSERVCHG'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CONTSERVD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CUSTBLD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='CUTOFF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='DVCM'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='ENERGIZE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='EQUIPCHANG'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='EQUIPVALID'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='HIGHLOAD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='LOCATE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='MAINT-EQ'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='MSYSTEMMGT'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NCBM'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NEWRES-WF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='NEW-WF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='POWER QUAL'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RECONIDLE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RECVERIF'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RETIRE1'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='RETIRE2'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SERVCHANGE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SPECIALPRJ'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SUBD'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='SYSTEMMGT'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='TREE'
                        OR  "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"='TRFX')
                    ORDER BY
                        "BI_LMN_SRV_REF"."BI_LMN_SRV_DESC" DESC,
                        "BI_SO_DET_VIEW_1"."BI_SO_TYPE_CD"
                        /* End Querey */
                ) T2
            JOIN
                BI_SO_DET_VIEW_1
            ON
                T2.BI_WRKFLW_KEY = BI_SO_DET_VIEW_1.BI_WRKFLW_KEY
            GROUP BY
                BI_WRKFLW.BI_LMN_SRV_AREA
                 )WOCOUNTThe last error I received is: [Error Code: 904, SQL State: S0022] [Oracle][ODBC][Ora]ORA-00904: "T2"."BI_WRKFLW_KEY": invalid identifier
    I want the final Output to be something similar to:
    OFFICE          WOCOUNT 
    0-OTHER         44.0       
    1-SUNDANCE      14.0     
    2-GILLETTE      29.0       
    3-SHERIDAN      11.0        
    4-West/Central  37.0       
    5-East/Central  58.0       Thanks for your help,
    :) John

    Hi, John,
    Johnbr (Oracle11G) wrote:
    Hi All,
    I'm failry new to PL/SQL... That's okay; there's no PL/SQL involved in this problem, and there's no PL/SQL needed, only SQL.
    That is wrapped within a counting Block that is giving me trouble:
    SELECT
    WOCOUNT.Office,
    WOCOUNT.WOCOUNT
    FROM
    SELECT
    CASE
    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '1'
    THEN '1-SUNDANCE'
    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '2'
    THEN '2-GILLETTE'
    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '3'
    THEN '3-SHERIDAN'
    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '4'
    THEN '4-West/Central'
    WHEN "BI_WRKFLW"."BI_LMN_SRV_AREA" = '5'
    THEN '5-East/Central'
    ELSE '0-OTHER'
    END                                AS Office,
    COUNT (T1.BI_LMN_SRV_AREA ) AS WOCOUNT
    FROM
    /* Begin Querey */
    /* End Querey */
    ) T2
    JOIN
    BI_SO_DET_VIEW_1
    ON
    T2.BI_WRKFLW_KEY = BI_SO_DET_VIEW_1.BI_WRKFLW_KEY
    GROUP BY
    BI_WRKFLW.BI_LMN_SRV_AREA
    )WOCOUNT
    The sub-query called wocount only involves 2 "tables", namely
    (1) T2
    (2) BI_SO_DET_VIEW_1
    (I put "tables" in quotes because T2 isn't really a table; it's an in-line view. Judging by the name, I'm guessing BI_SO_DET_VIEW_1 isn't really a table, either, but it doesn't matter. You have 2 things that serve as tables, so I'll just call them tables.)
    Since those are the only 2 tables, you can't reference BI_WRKFLW in WOCOUNT. That table is known inside T2, but not outside of T2.
    You can include "BI_WRKFLW"."BI_LMN_SRV_AREA" in the SELECT clause of T2, assuming that doesn't make more rows distinct. T2 will then look like this:
    ...             SELECT DISTINCT
                        BI_SO_DET_VIEW_1.BI_SO_STAT_CD
                        BI_SO_MASTER.BI_WO_WORKORD,
                  BI_WRKFLW.BI_LMN_SRV_AREA          -- New column added
                    FROM ...Then, inside WOCOUNT, you can use BI_LMN_SRV_AREA like this:
    ...         CASE
                    WHEN BI_LMN_SRV_AREA = '1'
                    THEN '1-SUNDANCE'
                    WHEN BI_LMN_SRV_AREA = '2'
                    THEN '2-GILLETTE'
                    WHEN BI_LMN_SRV_AREA = '3'
                    THEN '3-SHERIDAN'
                    WHEN BI_LMN_SRV_AREA = '4'
                    THEN '4-West/Central'
                    WHEN BI_LMN_SRV_AREA = '5'
                    THEN '5-East/Central'
                    ELSE '0-OTHER'
                END                                AS Office,or, to save a little typing:
    ...         CASE  BI_LMN_SRV_AREA
                    WHEN  '1'
                    THEN '1-SUNDANCE'
                    WHEN '2'
                    THEN '2-GILLETTE'
                    WHEN '3'
                    THEN '3-SHERIDAN'
                    WHEN '4'
                    THEN '4-West/Central'
                    WHEN '5'
                    THEN '5-East/Central'
                    ELSE '0-OTHER'
                END                                AS Office, 
    Speaking of saving on typing:
    Instead of
    WHERE
                            "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='001NS'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='010'
                        OR  "BI_TYPE_SERVICE"."BI_PRIM_RATE_SCHED"='RHRNS'
                  )you can use the IN operator, like this:
    WHERE              BI_TYPE_SERVICE.BI_PRIM_RATE_SCHED  IN ('001', '001NS', '010', ..., 'RHRNS') 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Simplify the problem as much as possible. For example, you would probably have the same problem if there were only 2 o4 3 tables involved in your query. Try to construct a problem that only has 2 or 3 tables, and post only those tables, and the results you want from them.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • Node count for SLOC estimate from .lvproj

    Hi,
    I am trying to get an estimate of SLOC for my project manager. Using the node count is good enough for our purposes. I am using LabVIEW 8.5. I want to use Tools->Profile->VI Metrics. However, our project has over 1200 VIs and everything is handled through a .lvproj. It would be nice if I could just select the Tools->Profile->VI Metrics setting from the .lvproj but this is greyed out. Is there any way to get a node count on my entire project easily or do I have to select the VI Metrics from all 1200 VIs? If this is the case, would I be correct in assuming that I should then do a count of the nodes from the actual name of the VI and not the total, so as to not count subVI's nodes twice as there are many that are called from multiple VIs(example: VI_Name.vi # of nodes, as opposed to -total- # of nodes)?
    Thank you,
    Roger Pennington

    I suppose that you have tried explaining to your project manager that SLOC is totally meaningless -- even for languages that have lines of code, which LV does not.
    But even making the "translation" to number of nodes, the number is still meaningless. It assumes that a lower number is always better. But I guess bean counters that don't know how to actually do the work, have to have something to count.
    So how 'bout 50400 -- that's 1200 * 42. It's a perfectly fine number and as valid as any other you might generate.
    Mike...
    PS: Where are your people from? I have some Penningtons in my family tree.
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Count with a conditional from another DATASET

    Hi guys!
    How could I count records in a table from another Dataset? I tried this, but I got syntaxis error on the comma that indicates the dataset. Please.
    =Count(IIf((Fields!new_leadsourceid.Value, "AllNewLeads") = Fields!new_leadsourceid.Value, 1, Nothing))
    Thank you.

    What do you mean "bring the data by groups"? And "total
    count, but divided by groups", do you mean you want an average across multiple input arrays?
    The Lookup expressions can be scoped to any valid scope. What is a valid scope depends on the context. If I put a Lookup expression in a table cell that is contained within a group, a valid scope is that group or any parent group up to and including the
    table's dataset.
    The custom code can be modified to accommodate multiple groups in the input and to return the total elements from all input arrays. The restrictions on custom code are the assemblies available on the server(s) where the code will execute. In most cases,
    server admins are reluctant to add custom assemblies or additional packages to their server. As long as you restrict your the code to use only what is available in the core .Net assemblies, it shouldn't be a problem. This custom code shouldn't be a problem
    for that.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • What is "count = 0, total = 123" ?

    When compiling and to a lesser extent running, I get output like:
    C:\src>javac foo.java
    count = 0, total = 137
    count = 0, total = 137
    count = 0, total = 137
    C:\src>
    The number in "total" and the number of lines of this output vary.
    Any ideas where it comes from and how to shut it up?
    Thanks.

    Do you get this if foo.java does not exist?
    What happens if you just type
    javac
    ?C:\Documents and Settings\ahicken\My Documents>javac
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are us
    ed
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options
    C:\Documents and Settings\ahicken\My Documents>

  • How to get total value from checkbox list?

    I have a list of checkbox items - all number values. I want to then get the total value from all of the check items and add that value to the database. Can this be done?
    Also, anyone know of one source where I can get detailed information on how to best use Web Apps and all of it's possibilities and limitations? Most of the tutorials that I have seen so far say that you can do most anything with Web Apps; however, the tutorial examples leave a lot of questions unanswered. I saw that Adobe has an article that shows how to build a basic web app and that it is "part 1" in a series. Anyone know where to find parts 2, 3, etc?
    Thanks,

    Hi there,
    Good day, i hope this will give you some ideas
    for example this is your html
    <input type="checkbox" name="test" value="1">1
    <input type="checkbox" name="test" value="2">2
    <input type="checkbox" name="test" value="3">3
    <input type="checkbox" name="test" value="4">4
    and this is your jquery script
    <script type="text/javascript">
    jQuery("input@[name='test']").click(function() {
        var istrue = jQuery(this).is(":checked");
        if(istrue == true) {
            var urvalue = jQuery(this).val();
            alert(urvalue);
    </script>
    hope this helps you

  • I see people from different ages at my work and every month I need to count how many people from each age I've seen that month. How can I do to give the entries to numbers in a single cell and make numbers count them for me?

    I see people from different ages at my work and every month I need to count how many people from each age I've seen that month. How can I do to give the entries to numbers in a single cell and make numbers count them for me? The final result would be a spreadsheet telling there were 8 people from 20 to 39 years old, 14 peolple from 40 to 59 and so on...

    jpqcampos wrote:
    This appears to be an 'input form' using 'Radio Buttons' to select the category. Neither of these features are supported in Numbers '09.
    You can input the data on one table and summarize it on a second table, but the input table will continue to hold data for each event.
    And by using the Reorganize button, you can hide all but two rows of that table to approximate the appearance and performance of an input form.
    Here are the two tables, Data on the left and Summary on the right. Notes below.
    The grey-filled columns in both tables are 'working' columns, and may be hidden (as shown in the image below).
    Data table:
    D1 contains the word "TRUE" (in capital letters). (This row is always shown.)
    D2 is empty, or may contain any value except "TRUE" (This row is always hidden under the Reorganize rule.)The rest of Row 2 of this table requires the data shown: a number outside the range to be counted (999), and two checkboxes, both checked.
    D3 (and filled down the rest of column D):   =AND(OR(B2,C2),NOT(OR(B3,C3)))
    The formula returns TRUE only for the first unused row in the table (ie. the first row for which neither checkbox has been checked)
    Summary table:
    Column A contains labels for the age ranges to be counted.
    Column B contains the same information in the form necessary for the formulas in columns C and D. They need a numeric value, and that value must be the largest acceptable value in the range to be counted.
    C2 (and filled right to column D, then both filled down to row 5):
        =COUNTIFS(Data :: $A,"<="&$B,Data :: B,TRUE)-SUM(C$1:C1)
    Two changes from the previous example:
    COUNTIFS is used to separate the Native and Foreign counts as well as the age range to be counted.
    The amount subtracted from each result is the SUM of the earlier results, and includes the text value in the first cell of the column (which is interpreted by SUM as a zero).
    See note below regarding my earlier formula.
    When the greyed columns are hidden and the checkbox in the Reorganize pane is checked, the two tables will appear as shown below:
    Close the reorganize pane, and the 'data entry form' is ready to use.
    To use, enter the age first, then check one of the boxes.
    As soon as one box is checked, the row will be hidden, and the next (unused) row will be shown.
    Regards,
    Barry
    Note regarding formula in my earlier post:
    The earlier formula will give erroneous results as it subtracts only the count directly above it from its count of persons in the age range 0-n.
    In E2 of that table, replace "-E1" with "-SUM(E1:E$1)
    Fill down to E8.
    Ignore the instructions (in that post) following "Fill down to E8."
    B

  • URGENT HELP NEEDED: counting number of particles from image

    this image on the left is showing particles
    hello i want to create a small VI that can count number of particles from a image that i load up. please see the attached image of particles and the VI printshot.
    I have used the tutorial "counting number of particles" but still the above VI does not work. it shows the number of particles = 1.. I do not know why it is doing so??
    I am not an expert in Labview so please can someone tell me where the problem is. sorry i could not attach the VI file itself but i have given an image of it..
    after anyone has solved this problem, i have to create a live system that will get live images from the camera - four frames every sec and the above VI has to count the
    number of particles for each frame and output to the user?? is this possible can anyone do it for me???
    p.s. in the above VI i read the image from file and count the number of particles. i do not do it to the binary image becuase the binary image is only a black screen
    when i run it
    thankyou

    Hi Farhan,
    Vision Assistant would be the best option to create some steps which you can then export to LabVIEW. You should try using the IMAQ Find Circles.vi. The attached image helps you find the number of circles of an image acquired from a camera. I have used the IMAQdx VIs in this example.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies
    Attachments:
    vision.vi ‏59 KB

  • How to transform data from hierarchy table to taxonomy table?

    Hi Friends
    Regarding my issue:
    1) I am having data in the hierarchy table which contains two fields(i.e. code, description) , now we have created another taxonomy table which contains two fields(i.e. code,description) same as hierarchy table.
    2) hierarchy table only contains data, which we have imported data into hierarchy table using import manager. we don't have data in the taxonomy table.
    3) now my issue is,we have to move that hierachical data in the hierarchy table to taxonomy without using import manager, only through the data manager using validations and assignments.
    4) If any one have solution to this issue, please help me out.
    Thanks in Advance
    bharat.chinthapatla

    Hi Ganesh,
    Thanks for your reply,
    I need to move data from hierarchy table to taxonomy table using validations and assignments.
    Thanks in Advance
    bharat.chinthapatla

  • Count of total number of rows, distinct count of column

    Hi ,
    I am looking for a procedure that will insert following data into columns :
    Table_name Column_name COUNT(*) , count(DISTINCT COL_NAME)
    EX: Employee emp_name 5000 4500
    Employee emp_location 5000 10
    I want this for the whole schema.
    I have a procedure which give me count(*) , but i am not able to write a procedure for count(DISTINCT COL_NAME)
    If some one can help me, that would be the really helpful
    Thanks

    SOmething like this could also work ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.50
    satyaki>
    satyaki>
    satyaki>SELECT table_name,
      2         column_name,
      3         DBMS_XMLGEN.getxmltype ('SELECT Count(*) c FROM ' || table_name).EXTRACT ('//text()').getnumberval() tot_rows,
      4         DBMS_XMLGEN.getxmltype ('SELECT Count( distinct '||column_name||') d FROM ' || table_name).EXTRACT ('//text()').getnumberval() unique_rows  
      5  FROM all_tab_columns 
      6  WHERE owner = 'SCOTT'
      7  AND   table_name in ('DEPT','SAL_GRADE','GRADE');
    TABLE_NAME                     COLUMN_NAME                      TOT_ROWS UNIQUE_ROWS
    DEPT                           DEPTNO                                  4           4
    DEPT                           DNAME                                   4           4
    DEPT                           LOC                                     4           3
    GRADE                          SUBJECT                                 2           2
    GRADE                          UPN                                     2           2
    GRADE                          L_EVEL                                  2           2
    GRADE                          GRADE                                   2           2
    GRADE                          TID                                     2           2
    GRADE                          ACADEMICYEAR                            2           1
    SAL_GRADE                      MAX_SAL                                 6           6
    SAL_GRADE                      MIN_SAL                                 6           6
    TABLE_NAME                     COLUMN_NAME                      TOT_ROWS UNIQUE_ROWS
    SAL_GRADE                      GRADE                                   6           6
    12 rows selected.
    Elapsed: 00:00:01.06
    satyaki>
    satyaki>
    satyaki>You may have to work a little - if you want to use this for all the case.
    Regards.
    Satyaki De.
    Added column name
    Off course credit goes to Michael. ;)
    Edited by: Satyaki_De on Jan 27, 2009 12:19 AM

  • Ho to count the total number of rows Sql Reporting Services Report Builder's Dataset after filteration based on parameter

    Hi to all,
                 I have parameter and data-set i.e consists of SharePoint List items,Data-set get's  filters and I need to count the total rows of the data-set i.e I get after filtration.
    Thanks, Quality Communication Provides Quality Work. Mohammad Siddiqali.

    Hi siddiqali,
    Thanks for the question and Destin Joy’s reply. Please try to add the filter in the dataset level rather than the data region
    level. Detail steps as below.
    1.      
    Double-click the dataset name in the Report Data window, click Filters in the left panel.
    2.      
    Click Add button, choose Admission Date in the Expression drop-down list. Type in the Value textbox with the parameter name: @selectDate.
    3.      
    Right-click the cell that your identified by the red circle, select Expression, type in it with:
    =CountRows("DataSetName")
    Thanks,
    Sharp Wang
    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.

  • Is there a way I can have my form calculate a total time from beginning and ending time?

    Is there a way I can have my form calculate a total time from beginning and ending time?

    Sorry, but Formscentral doesn't support either a timer function or any kind of calculation. You might be able to do this if created your form in PDF. For help with PDF form creation in Acrobat I suggest you repost your question to the Acrobat Forum.
    Andrew

  • Seems counter-intuitive to upgrade from QuickTime 10.3 to QuickTime 7 just to get to QuickTime Pro.  Is there no QuickTime 10.3 Pro?

    It seems counter-intuitive to upgrade from QuickTime 10.3 to QuickTime 7 just to get to QuickTime Pro.  Am I missing something here?  Is there no QuickTime 10.3 Pro?

    QuickTime Pro is based on the QuickTime 7 code, and requires it to run. The old QuickTime was initially intended for movie and sound bites, such as you might find embedded in a Web page. It was not intended for handling the massive size and quantity of current movie and music formats, and Apple had to work the code in odd ways to get it to run the latest content. Not being ideal, Apple decided to re-write QuickTime from the ground up. It has kept QuickTime 7 and its supported features (ie, QuickTime Pro) for compatibility, but is moving foward with the next generation of QuickTime, called QuickTime X. So far this does not have a "Pro" version add-on, and Apple has not indicated it is developing one. For now, if you want advanced features you will need to use software like Final Cut Pro, or a third-party program, which make these routines available to you. There are also a number of third-party tools that do similar features, without interfacing with QuickTime at all.

Maybe you are looking for