Count Metric based on two physical columns

I have a fact table that has Beginning Inventory On Hand (BOH) Units and Ending Inventory On Hand (EOH) Units.
It also contains sales dollars and sales units and other facts. My dimensions are: Locations, Time, Products.
Locations
     All Stores
     Region
     District
     Store
Products
     All Products
     Division
     Entity
     Subdivision
     SubClass
Time
     Week
We have fact tables at the lowest level and we have aggregrate tables at certain points.
We are trying to create some count metrics in the BMM Layer. We have created a metric that will count the number
of stores that have Sales Units at each level of the product dimension. We did this by mapping the logical column
to the physical column of Sales Units. We then defined the aggregation for this metric based on dimensions. The
first thing we needed to do is Sum the Sales Units across Products, so we set the "Other" as a sum. We then need
to apply the Count Distinct, so we set this at the Location Dimension.
Based On Dimensions
Sum(Sales Units)                              - Other Dimensions
Count (Distinct Case When Sales Units > 0 then store number else null end )     - Location Dimension
This will give a final rule as follows:
Count (Distinct Case When SUM(Sales Units) > 0 then store number else null end )
This is working great. However, we now want to create a logical metric that will count the number of stores based on the evaluation of two physical columns.
Count the number of stores that have Sales Units > 0 OR EOH Units > 0.
I do not know how to evaluate two physical columns and apply a count against them.
Thanks in advance for your help.

create same column for sum(eoh)
Count (Distinct Case When SUM(Sales Units) > 0 then store number
else
case when SUM(eoh) > 0 then store number else null end
else null end )

Similar Messages

  • Calculation based on two result columns in combined report

    Hi all - I have a combined analysis and I need to add a result column based on two of my result columns. The calculation involves one column from my first report and one column from my second report.
    The first report has # of opportunities and my second report has a number of booked opportunities. I have to have two separate reports because these two columns need to be filtered on different dates. In my result column, I want to add a column that gives me close % which is # of booked opps/# of opps. I am using the SAW references but it is not working right. I have tried the following calculations:
    (SUM(SAW_9 BY SAW_1) / SUM(SAW_7 BY SAW_1))*100 This gives me 100% in any row that is 1 opp to 1 booked opp. But gives me 0 in all the other fields even if it is 2 opps to 1 booked opp.
    (MAX(SAW_9 BY SAW_1) / MAX(SAW_7 BY SAW_1))*100 This shows 100% for every row that has a number in the opp and booked opp columns. Even shows 100% if it is 2 opps to 1 booked opp which should be 50%.
    Any ideas on what formula I need to use to get the right calculation?
    Thanks!
    Lacey

    Lacey,
    (SUM(SAW_9 BY SAW_1) / SUM(SAW_7 BY SAW_1))*100 is the correct formula so the only thing I can think of is do you have the correct columns selected?
    SAW_9 is column 10 and SAW_1 is column 2?
    and I think the aggregation rule needs to be sum as well.
    Good Luck
    Alex
    PS thanks to Mike Lairson for putting this solution in his book as it got me working.

  • SQL Server Reporting Services- Coloring a Cell Background Based on two different column group values

    Hello All,
    I have a matrix report with time scale on the x axis  and Resources on Y axis Showing the tasks assigned to each resource for a period of time. Here I have to color a matrix cell showing task details on tool tip with background color of the cell.
    So Please help me on this.I have a expression like this...
    In my case the color should be filled for the cell with name "Fields!task_name.Value" based on the values of "Fields!Day_Wise.Value " where we have the values for Daywise as S,M,T,W,T,F,S. So i need the background for the cell with name
    task_name as Light Grey on Friday and Saturday, But we have the same name S for sunday also, which should come in different color.
    =iif(Fields!Day_Wise.Value ="F","LightGrey",
    IIF(PREVIOUS(Fields!Day_Wise.Value) ="F","LightGrey",
    iif(Fields!task_name.Value="","White",
    iif(InStr(Fields!task_name.Value,"||")>0,"Maroon",
    iif(InStr(Fields!task_name.Value,"NULL")>0,"Sienna",
    iif(InStr(Fields!task_name.Value,"Pink")>0,"Pink",
    iif(InStr(Fields!task_name.Value,"Red")>0,"Red",
    iif(InStr(Fields!task_name.Value,"Purple")>0,"Purple",
    iif(InStr(Fields!task_name.Value,"Green")>0,"Green",
    iif(InStr(Fields!task_name.Value,"White")>0,"White",
    iif(InStr(Fields!task_name.Value,"Cyan (Teal)")>0,"Teal",
    iif(InStr(Fields!task_name.Value,"Olive")>0,"Olive",
    iif(InStr(Fields!task_name.Value,"Blue")>0,"Blue",
    iif(InStr(Fields!task_name.Value,"Light Blue (Aqua)")>0,"LightBlue",
    iif(InStr(Fields!task_name.Value,"Yellow")>0,"Yellow","Black"
    Thanks
    AJ Hameed

    Hi AJ Hameed,
    According to your description, you want to set the background color for the cells based on the values inside of cells and the values the column group. You want to set grey for cells on Friday and Saturday, set colors based on the task name on other weekdays.
    Right?
    In Reporting Services, there's no problem if we have two different data values in conditional expression, so we can set background color based on Day_Wise or task_name. One issue in this scenario is, we can't have value "S" for both Saturday and Sunday when
    working in a matrix. Otherwise the task_name will overwrite the previous task_name (for numeric values, it will do sum calculation). So we suggest you change the values for weekdays in database. The expression you have posted was correct. It only has a small
    issue: the "Light Blue(Aqua)" also contains "Blue", so when doing conditional judging, the expression will return "Blue" instead of "Light Blue". We have tested in our local environment. For viewing convenience, we used the Switch() function in our expression:
    =IIf(Fields!Day_Wise.Value="Fri" or Fields!Day_Wise.Value="Sat","LightGrey",
    Switch(
    InStr(Fields!Task_name.Value,"White")>0,"White",
    InStr(Fields!Task_name.Value,"||")>0,"Maroon",
    InStr(Fields!Task_name.Value,"Pink")>0,"Pink",
    InStr(Fields!Task_name.Value,"Red")>0,"Red",
    InStr(Fields!Task_name.Value,"Purple")>0,"Purple",
    InStr(Fields!Task_name.Value,"Green")>0,"Green",
    InStr(Fields!Task_name.Value,"Cyan(Teal)")>0,"Teal",
    Fields!Task_name.Value="","White",
    InStr(Fields!Task_name.Value,"Olive")>0,"Olive",
    InStr(Fields!Task_name.Value,"Blue")>0,"Blue",
    InStr(Fields!Task_name.Value,"Aqua")>0,"LightBlue",
    InStr(Fields!Task_name.Value,"Yellow")>0,"Yellow",
    InStr(Fields!Task_name.Value,"Orange")>0,"Orange",
    InStr(Fields!Task_name.Value,"Null")>0,"Sienna",
    true,"Black"
    The result looks like below:
    Reference:
    Matrices (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • MAX: how to create a Calculated Channel based on two physical channels?

    Good morning,
    I need to configure some tasks in MAX with Virtual Channels that are calculations based on physical channels. I saw this article : http://digital.ni.com/public.nsf/allkb/1BFCE6FAD5B3944986256D67006DF7EC but cannot see the equivalent in the newest versions of MAX (V5.1).
    As an example I am already acquiring the physical channels Ch1 and Ch2 and I want to build a virtual channel Ch3=E+(A.Ch1+B)/(C.Ch2+D). A,B,C,D,E are constant values. I would then like to integrate Ch3 in a task together with other physical channels that I am acquiring.
    Could you direct me to this function?
    Thanks for your answer.
    Christophe

    Hello Christophe,
    With the newer versions of NI DAQmx and NI MAX there was a choice made to go from the relatively limited VI Logger options to a more extensive form of configurable applications.
    For this purpose (and others) NI Signal Express was created, which allows you to configure applications with a limited amount of programming.
    To do similar (and more things) then you were used to do with VI Logger you can use NI SignalExpress
    http://www.ni.com/white-paper/5825/en/
    http://www.ni.com/white-paper/5827/en/
    This specific VI logger functionality for the creation of ""virtual channels" (step 5 to 10) through VI Logger Tasks (directly from inside NI MAX) however does no longer exist.
    This also more clearly seperates your Configuration Tools (like NI MAX) from your actual applications made with LabVIEW or SignalExpress.
    Would using NI SignalExpress be an option for you?
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.

  • Two physical logical source formulas for on logical column

    I have two fact tables :
    1. W_SERVICE_REQ_F(opened_dt_wid, assigned_dt_wid, closed_dt_wid, QUEUE_WID, SERVICE_REQ_WID): grain is one row per service request
    2. W_SERVICE_REQ_DAY_A(DATE_WID, QUEUE_WID, NUM_OPENED, NUM_CLOSED, num_assigned)
    The goal is to answer NUM_OPENED, NUM_CLOSED per queue in a day and be able to drill-down to those service requests.
    Physical model:
    Common_Date.row_wid = W_SERVICE_REQ_F (Opened_Dt).opened_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_F (Closed_Dt).closed_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_DAY_A.DATE_WID
    Queue_d.row_wid = W_SERVICE_REQ_F.QUEUE_WID
    Queue._drow_wid = W_SERVICE_REQ_DAY_A.QUEUE_WID
    Service_req_d.row_wid = W_SERVICE_REQ_F.SERVICE_REQ_WID. (there is no join between Queue_d and Service_req_d)
    BMM Fact and LTSs:
    I have W_SERVICE_REQ_DAY_A, W_SERVICE_REQ_F (Opened_Dt), W_SERVICE_REQ_F (Closed_Dt) as LTSs of "Fact - Service Request" in that order.
    BMM Fact logical columns (measures):
    # Closed
    # Opened
    Question:
    I want to configure each of the above logical column with two physical columns of different aggregate forumlas. (to ensure queries that dont need service req number hit a table) (similar to http://www.gerardnico.com/wiki/dat/obiee/fragmentationlevel_based).
    SUM(W_SERVICE_REQ_DAY_A.NUM_CLOSED)
    COUNT("W_SERVICE_REQ_F (Closed_Dt)".SERVICE_REQ_WID)
    Can someone help in configuring one logical column with two physical column sources with different aggregate formulas?
    This is what I tried:
    In # Opened Properites->Data Type, mapped it to both W_SERVICE_REQ_F (Closed_Dt).ROW_WID and W_SERVICE_REQ_DAY_A.NUM_CLOSED
    In # Opened Properties->Aggregation tab, selected 'Default aggregation rule' as Count Distinct. In the bottom, Logical table sources override as follows:
    W_SERVICE_REQ_DAY_A : SUM("Fact - Service Request"."# Closed")
    W_SERVICE_REQ_F : COUNT("Fact - Service Request"."# Closed")
    Should it be done in a different way?
    PS: OBIEE 10.1.3.4.
    added OBIEE version: Feb 3, 2012 4:40 PM

    I have two fact tables :
    1. W_SERVICE_REQ_F(opened_dt_wid, assigned_dt_wid, closed_dt_wid, QUEUE_WID, SERVICE_REQ_WID): grain is one row per service request
    2. W_SERVICE_REQ_DAY_A(DATE_WID, QUEUE_WID, NUM_OPENED, NUM_CLOSED, num_assigned)
    The goal is to answer NUM_OPENED, NUM_CLOSED per queue in a day and be able to drill-down to those service requests.
    Physical model:
    Common_Date.row_wid = W_SERVICE_REQ_F (Opened_Dt).opened_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_F (Closed_Dt).closed_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_DAY_A.DATE_WID
    Queue_d.row_wid = W_SERVICE_REQ_F.QUEUE_WID
    Queue._drow_wid = W_SERVICE_REQ_DAY_A.QUEUE_WID
    Service_req_d.row_wid = W_SERVICE_REQ_F.SERVICE_REQ_WID. (there is no join between Queue_d and Service_req_d)
    BMM Fact and LTSs:
    I have W_SERVICE_REQ_DAY_A, W_SERVICE_REQ_F (Opened_Dt), W_SERVICE_REQ_F (Closed_Dt) as LTSs of "Fact - Service Request" in that order.
    BMM Fact logical columns (measures):
    # Closed
    # Opened
    Question:
    I want to configure each of the above logical column with two physical columns of different aggregate forumlas. (to ensure queries that dont need service req number hit a table) (similar to http://www.gerardnico.com/wiki/dat/obiee/fragmentationlevel_based).
    SUM(W_SERVICE_REQ_DAY_A.NUM_CLOSED)
    COUNT("W_SERVICE_REQ_F (Closed_Dt)".SERVICE_REQ_WID)
    Can someone help in configuring one logical column with two physical column sources with different aggregate formulas?
    This is what I tried:
    In # Opened Properites->Data Type, mapped it to both W_SERVICE_REQ_F (Closed_Dt).ROW_WID and W_SERVICE_REQ_DAY_A.NUM_CLOSED
    In # Opened Properties->Aggregation tab, selected 'Default aggregation rule' as Count Distinct. In the bottom, Logical table sources override as follows:
    W_SERVICE_REQ_DAY_A : SUM("Fact - Service Request"."# Closed")
    W_SERVICE_REQ_F : COUNT("Fact - Service Request"."# Closed")
    Should it be done in a different way?
    PS: OBIEE 10.1.3.4.
    added OBIEE version: Feb 3, 2012 4:40 PM

  • Update column based on two columns

    Hi,
    MinValue     MaxValue    Desc
    -1                -1    
    -1                 1    
    -1                 2    
    0                  0    
    0                  1    
    0                  2 
    The above is my table which is having three columns MinValue, MaxValue, Desc. First two columns have data and I need to update the 3rd column 'Desc' based on two columns data.
    I need to update like,
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    The data in 'MaxValue' is like 1,2,3,4,5...50. So for each description it should append this value as mentioned above(till 'Up to 50', 'At least 50'). How can I do this with case statement?
    Thanks,
    Gangadhar

    declare @T table ( MinValue int,MaxValue int, [Desc] nvarchar(100) );
    insert @T ( MinValue, MaxValue )
    values ( -1, 1 ) , ( -1, 1 ) , ( -1, 2), ( 0, 0), ( 0, 1), ( 0, 2)
    select *
    from @T
    update @T
    set [Desc] = case
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    end
    select *
    from @T
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Sorting based on two columns in report

    Hi,
    we have one issue on sorting based on two columns in report.
    In the report we are doing sorting on two columns(week_id and stage_name). I have attached the screen shot for the same. The sorting is first done on the week_id and then on the stage_name. The issue comes when we have no data for the stage 1 - Prospect in W1. The stage goes to the second position.
    Please suggest if there is any work around to show the 1 - Prospect stage in W1.
    Regards,
    Ambika Nanda.

    what is w1? where is screenshot? and is stage seoncd sort? if so what is the issue?

  • Percentage based on two result of the columns

    Hi all,
    My report loos like
    Type     posting order  Number of records  Date diff    %
    A     1          1        1
    A     2          1       1
    A     3          1       1
       Result                          3     3                 100%
    B     1          1       1
    B     2          1       1          
    B     3          1       0
       Result          3          2                  66%
    As u can see that i need to calculate the percentage based on the result of two columns.
    Can u please throw some light ..
    Watin for reply
    Thanks
    Babu

    Hi Babu,
    I think your example is not totally clear. From what I understand, you need to calculate a result in percentage based on the result of two other columns. What you can do is to use the first result (from the two columns) as a CKF. And then, to this CKF, use the result calcultation options of the query desinger for percentage.
    Hope this helps.
    Regards,
    Diego

  • Getting DISTINCT count from two different columns

    Hi all,
    I have following query which gives currency code from two different tables. I would like to get the distinct count of currency codes from these two different columns.
    SELECT eb.person_seq_id, eb.bonus_amount, eb.currency_cd, ed.currency_cd_host
    FROM fr_emp_bonuses eb, fr_emp_details ed, fr_periods p
    WHERE eb.person_seq_id = ed.person_seq_id AND ed.period_seq_id = eb.period_seq_id
    AND ed.period_seq_id = p.period_seq_id AND p.period_status = 'CURRENT'
    AND eb.bonus_amount >= 0 AND eb.person_seq_id = 3525125;
    This query gives following result
    3525125     240000     USD     INR
    3525125     0      USD     INR
    3525125     60000      USD     INR
    3525125     50000      USD     INR
    There are two distinct currency codes (USD, INR) and total amount is 350000. So I am looking for a query to give me the following result
    3525125     350000 2
    Thanks in advance

    Hi,
    Here's one way:
    WITH     original_query     AS
         SELECT  eb.person_seq_id
         ,     eb.bonus_amount
         ,     eb.currency_cd
         ,     ed.currency_cd_host
         FROM     fr_emp_bonuses         eb
         ,     fr_emp_details          ed
         ,     fr_periods          p
         WHERE      eb.person_seq_id    = ed.person_seq_id
         AND      ed.period_seq_id    = eb.period_seq_id
         AND      ed.period_seq_id    = p.period_seq_id
         AND      p.period_status         = 'CURRENT'
         AND      eb.bonus_amount     >= 0
         AND     eb.person_seq_id    = 3525125
    ,     unpivoted_data     AS
         SELECT     person_seq_id
         ,     bonus_amount
         ,     currency_cd
         FROM     original_query
        UNION ALL
            SELECT  person_seq_id
         ,     0               AS bonus_amount
         ,     currency_cd_host     AS currency_cd
         FROM     original_query
    SELECT       person_seq_id
    ,       SUM (bonus_amount)          AS total_bonus_amount
    ,       COUNT (DISTINCT currency_cd)     AS distinct_currency_cds
    FROM       unpivoted_data
    GROUP BY  person_seq_id
    ;There may be a shorter, more efficient way to get the same results, but without knowing more about your tables, I can't tell.
    The tricky thing is getting two columns (currency_cd and currencuy_cd_host in this case) counted together. You can't simply say
    COUNT (DISTINCT eb.currency_cd) +
    COUNT (DISTINCT ed.currency_code_host)That happens to get the correct result with the sample data you posted, but what if you had data like thEe following?
    currency_cd     currency_cd_host
    INR          USD
    USD          INRHere, the count of distinct currency_cds is 2, and the count of distinct currency_cd_hsots is also 2. Does that mean the grand total is 2 + 2 = 4? No, the 2 codes in one column arte the same 2 codes as in the other column. We need to get both currency_cd and currency_cd_hsot into the same column, and then do COUNT (DISTINCT ...) on that combined column. A UNION, as shown above, will certainly do that, starting with your query as you posted it. The query you posted isn't necessarily the best frist step towards this result, however, so there may be a much better approach, depending on your tables.
    Edited by: Frank Kulash on Feb 1, 2012 6:21 PM
    Here's a slightly shorter, and probably more efficient way to get the same results:
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 2
    SELECT       eb.person_seq_id
    ,       SUM (eb.bonus_amount)          AS total-amount
    ,       COUNT ( DISTINCT CASE
                        WHEN  c.n = 1
                        THEN  eb.currency_cd
                        ELSE  ed.currency_cd_host
                      END
              )               AS distinct_currency_cds
    FROM       fr_emp_bonuses    eb
    ,       fr_emp_details    ed
    ,       fr_periods          p
    ,       cntr              c
    WHERE        eb.person_seq_id  = ed.person_seq_id
    AND        ed.period_seq_id  = eb.period_seq_id
    AND        ed.period_seq_id  = p.period_seq_id
    AND        p.period_status   = 'CURRENT'
    AND        eb.bonus_amount   >= 0
    AND       eb.person_seq_i   = 3525125
    --       NOTE: no join condition involving c; we really do want a cross-join
    GROUP BY  eb.person_seq_id
    ;

  • Count Distinct based on another column in the same table

    Hello,
    My question in short: is is it possible to add a new column to a view which holds the DISTINCT COUNTS of values/domains of another column in the same view?
    For example, in the below table the column "Distinct Count of Occurence" shows how many distinct values a person has in the Occurence column. So AAA has 1 and 2 therefore it is 2 distinct values etc.
    My issues is that I can retrieve unique values bu Count (Select Occurence)but I can not add the new column that would add the records to the corresponding Persons in the above table.
    Is there an easy way to achieve this on the DWH level or should it be done with MDX in the cube?
    Thanks

    Hi,
    Below a solution to use the view by adding a column with window functioning, maybe this will help.
    CREATE TABLE #TMP
    PERSON VARCHAR(10),
    OCCURENCE SMALLINT
    --DROP TABLE #TMP
    INSERT INTO #TMP(PERSON,OCCURENCE)
    VALUES
    ('AAA','1'),
    ('AAA','2'),
    ('BBB','1'),
    ('BBB','1'),
    ('BBB','1'),
    ('CCC','1'),
    ('CCC','2'),
    ('CCC','3');
    --TRUNCATE TABLE #TMP
    WITH CTE
    AS
    SELECT PERSON
    ,OCCURENCE
    ,ROW_NUMBER() OVER(PARTITION BY PERSON ORDER BY OCCURENCE) AS RN
    FROM #TMP
    SELECT PERSON, MAX(RN) AS RN
    FROM CTE
    GROUP BY PERSON
    Regards,
    Reshma
    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

  • Problem creating hierarchy based on 2 physical dimension tables

    I'm having a problem creating 1 logical dimension with a drill-down hierarchy, based on two separate physical dimension tables. The errors I receive when navigating the drill-down hierarchy is:
    "Cannot find logical table source coverage for logical columns" &
    "Missing join between logical tables".
    I'm using OBIEE 10.1.3.4
    Here are the details of what I have setup sofar:
    Physical layer:
    Dimension table DIM_ORG with columns:
    -dimension_key
    -org_total_code
    -org_total_description
    -org_detail_code
    -org_detail_description
    Dimension table DIM_DEPT with columns:
    -dimension_key
    -dept_total_code
    -dept_total_description
    -dept_detail_code
    -dept_detail_description
    Fact table FACT_SALES with columns:
    -fk_org
    -fk_dept
    -sum_sales
    Physical Joins:
    FACT_SALES.fk_org = DIM_ORG_dimension_key
    FACT_SALES.fl_dept = DIM_DEPT.dimension_key
    Business Model & Mapping layer:
    I created a logical dimension ORG_DEPT. It contains two logical table sources (DIM_ORG & DIM_DEPT) and the following logical columns:
    - All Departments (mapped to dept_total_code)
    - Organisation (mapped to org_detail_description)
    - Organisation Number (mapped to org_detail_code)
    - Department (mapped to dept_detail_description)
    - Department Code (mapped to dept_detail_code)
    The business logical key is based on the combination of Organisation Number & Department Code
    The hierarchy I need is: All Departments -> Organisation -> Department so I created the following hierarchy for ORG_DEPT:
    - Total Level containing: All Departments
    - Organisation Level containing: Organisation Number (defined as the Logical level key) & Organisation (defined als the Drill level key)
    - Detail Department Level containing: Department Code (defined as Logical level key) and Department (defined as Drill level key).
    In the LTS of the dimension ORG_DEPT I've set the Content levels for the sources:
    DIM_ORG : Organisation Level
    DIM_DEPT: Detail Department Level
    In the LTS no -inner- joins have been added against related physical tables.
    I created a logical fact table SALES (based on the physical fact table) and joined it against the logical dimension table ORG_DEPT.
    In the LTS the Content level for ORG_DEPT is set against the Detail Department Level. No - inner- joins have been aded against related physical tables.
    When I create a report in Answers to test the hierachy and select only 'All Departments' I get the correct dimension value returned. When I try to drill to the next level I get the following ODBC error:
    "Cannot find logical table source coverage for logical columns: [All Departments]. Please check more detailed level keys are mapped correctly".
    When I create a report in Answers and select both 'All Departments' and 'Sales' I get the correct result. When I try to drill to the next level I get a different ODBC error:
    "Missing join between logical tables DIM_DEPT and DIM_DEPT: There must be at least one physical join link between the underlying physical tables".
    Any suggestions are welcome!
    Thanks!

    Hello Robert,
    Your suggestions were known to me but I still wanted to combine the two physical dimension tables in one logical dimension. So I've played around a bit more and found the solution: In my original setup I had two seperate logical table sources (one for each physical dimension table). The solution was to combine the two logical table sources in one logical table source. I achieved that by logical joining the DIM_DEPT table to the FACT_SALES table and subsequently to the DIM_ORG within the 1 LTS and using inner joins.
    Then I created the logical table key (a combination of org_detail_code & dept_detail_code). After that I could create the hierarchy with no problem.
    Edited by: The_Dutchman on Nov 4, 2011 9:43 PM

  • Create two logical columns with same LTS mapping but diff filter conditions

    Hi,
    Problem:
    How to create two logical columns within same logical table mapped to same physical column but different filter conditions?
    I have a scenario where in,
    Physical layer columns
         - table1.employee
         - table1.emp_city
    I need a columns in logical layer:
    Logical layer - lt1.count_emp_delhi (counts distinct employees whose city_name = 'Delhi')
              lt1.count_emp_mumbai(counts distinct employees whose city_name = 'Mumbai')
    My approach:
    For Delhi column
    1. Create a logical column lt1.count_emp_delhi mapped to the physical column table1.employee
    2. Aggregate using countdistinct in aggregate tab.
    3. Edit the mapping condition
         3.1. Use the where clause and set table1.emp_city='Delhi'.
    For Mumbai column.
    Followed the same approach as above but in 3.1 if I change the condition to 'Mumbai', even the delhi column is populated with mumbai count which is ERRONEOUS
    Could some one please help?

    Hi,
    1. Create two alias tables for table1 in Physical Layer. Lets say TB_Mumbai and TB_Delhi
    2. Create a logical table in BMM layer (D1 Employee Cities )
    3. Drag and drop the employee & emp_city columns from both alias tables (TB_Mumbai and TB_Delhi ) into your newly created logical table.
    4. Now you can see two Logical Table Sources (TB_Mumbai and TB_Delhi )
    5. Now using Where condition, write the condition on each table
    NOTE: Don't write any condition on the Physical table Table1.
    Hope it helps you.
    Regards,
    Kalyan Chukkapalli
    http://123obi.com

  • Cross tab report's -one column display total counts of previous financial year, one column current financial year

    Hi
    I'm using CR XI. I'm attempting to create  a cross-tab report where:
               Added       Total
    AF         12            23
    F            15           30
    CO         18           50
    Where AF etc is the categoty of items, Added is the total count of previous finanical year(e.g. 1 July 2006 to 30 June 2007), Total is the total account of current finanical year.
    The count is based on created_date field(e.g. ITD.DTE -- ITD is the table, DTE is the field).
    Although I can at the moment only display the value correctly in "Added"  column, if I tried to display the Total column, the two columns always have the same value.
    How could I achieve the above desired results by using fomula? I would appreciate it very much if anyone could help me with this?
    Thanks in advance
    JS

    Create 2 formulas, 1 for the previous year and 1 for current, similar to the following;
    1) if date({Orders.Order Date}) in date(2003,07,01) to date(2004,06,30) then 1 else 0
    2) if date({Orders.Order Date}) in date(2004,07,01) to date(2005,06,30) then 1 else 0
    Add both of these formulas as the summarized fields in the crosstab

  • Generate counter output based on a digital trigger

    I am trying to output a train of pulse based on a digital trigger (GO bit). When the GO bit goes high, I want to output a pulse train after an initial delay (ie: 2 seconds). When the GO bit goes low, I want to stop this pulse train. When the GO bit goes high again, I want to start the same pulse train with the same initial delay.
    The output pulse train has 2 frequencies so I am using 2 counters that generate the same pulse but one of them is delayed by a certain amount. Then I combine the output from both counters into one output using simple BNC T connector. Since I am using 2 counters (max # of counters available to me), I can't create a finite pulse train.
    If I use a pause trigger, the only problem is that  the second time the GO bit goes high, the initial delay is not used (each channel or counter has a different delay).
    So far the only way I can think of is by software timing the counter (by counting the time since the task has started) and stopping the task once certain amount of time has passed. Then I wait for a second trigger which should start the pulse train again with the initial delay.
    Is there a better way to do this? 

    One more thing:
    Is there any way to use a digital trigger that is based on two different digital signals ANDed together? I basically want to output the pulses when 2 digital inputs are binary 1 at the same time.

  • Can we create a hierarchy based on two logical table in 10g RPD

    Hi,
    I have a question, please give me some clarity, about creating hierarchy,
    I know we can create a hierarchy based on one logical table which is form by two physical table...
    Can we create a hierarchy based on two logical table? If yes, and how?
    Thanks in advance!
    anne

    Use preffered drill paths...
    -suman

Maybe you are looking for