Distinct count using lookup table

How can I get a distinct count of column values using a different table?
Let's say I want to get a distinct count of all "company_name" records in table "emp" that corespond (match) with "lookup" table, "state" category.
What I want is to find counts for all companies that have a value of "california" in the "state" column of the "lookup" Table. I want the output to look like:
Sears 17
Pennys 22
Marshalls 6
Macys 9
I want the result to show me the company names dynamically as I don't know what they are, just that they are part of the "state" group in the lookup Table. Does this make sense?
M

Mark,
In the future you might consider creating test cases for us to work with. Something similar to the following where sample data is created for each table as the union all of multiple select statementsselect 'INIT_ASSESS' lookup_type
     , 1 lookup_value
     , 'Initial Assessment' lookup_value_desc
  from dual union all
select 'JOB_REF', 2, 'Job Reference' from dual union all
select 'SPEC_STA', 3, 'SPEC STA' from dual;
select 'INIT_ASSESS' rfs_category
     , 1 val
  from dual union all
select 'JOB_REF', 1 from dual union all
select 'JOB_REF', 1 from dual union all
select 'SPEC_STA', null from dual;Then we can either take your select statements and make them the source of a CTAS (create table as) statementcreate table lookup as
select 'INIT_ASSESS' lookup_type
     , 1 lookup_value
     , 'Initial Assessment' lookup_value_desc
  from dual union all
select 'JOB_REF', 2, 'Job Reference' from dual union all
select 'SPEC_STA', 3, 'SPEC STA' from dual;, or include them as subfactored queries by using the with statement:with lookup as (
select 'INIT_ASSESS' lookup_type
     , 1 lookup_value
     , 'Initial Assessment' lookup_value_desc
  from dual union all
select 'JOB_REF', 2, 'Job Reference' from dual union all
select 'SPEC_STA', 3, 'SPEC STA' from dual
), RFS as (
select 'INIT_ASSESS' rfs_category
     , 1 val
  from dual union all
select 'JOB_REF', 1 from dual union all
select 'JOB_REF', 1 from dual union all
select 'SPEC_STA', null from dual
select lookup_value_desc, count_all, count_val, dist_val
  from lookup
  join (select rfs_category
             , count(*) count_all
             , count(val) count_val
             , count(distinct val) dist_val
          from RFS group by rfs_category)
    on rfs_category = lookup_type;Edited by: Sentinel on Nov 17, 2008 3:38 PM

Similar Messages

  • Set Aggregation type of Count Distinct to use correct table aggregation in

    Hi there,
    Currently I use OBIEE 10.1.3.4.1 , and there is a case where a fact table consist of 2 logical table source: detail and aggregate table, which has some measure using count distinct as aggregation type. The problem is everytime I browse the measure with no dimension at all , it always use detail table not aggegation one..
    Really appreciate for any suggestion ..
    thanks a lot

    Hi,
    I don't think it's the same case as mine. Let say I have 2 table : detail and aggegate
    Detail Table consists 4 fields:
    *) Period
    *) Market
    *) Region
    *) Measure : Customer ID, Sales
    Aggregate Table consists 3 fields :
    *) Period
    *) Region
    *) Measure : Customer ID, Sales
    in the measure I set aggregation type for each field:
    *) Sales >> set as Sum
    *) Customer ID >> copy as "Number of Customer" and set as Count Distinct
    In each LTS' contents I set the level of aggregation using "Get Levels" feature..
    Then I try to browse via Presentation and do some querys belows:
    a) only choose single field of measure : Sales, the session shows that the value is taken from aggregation table and just as I expected.
    b) choose period and sales, the session shows that the values are taken from aggregation table, and still just as I expected.
    c) choose period, sales , and market, the session shows that the values are taken from detail table, just as I expected.
    d) only choose single field of measure : "Number of Customer", the session shows that the value is taken from detail table , this is NOT as I expected. It suppose to take the value from aggregation table..
    e) choose period and "Number of Customer", the session shows that the value is taken from detail table , this is also NOT as I expected. It suppose to take the value from aggregation table..
    I've tried to override the aggregation , but still confuse how to apply in measure "Number of Customer" and did not work at all..
    any idea ?
    thanks a lot

  • Maintaining distinct counts in summary tables - thoughts

    Hi,
    We have a 3bn row transaction fact table of sales by product_id and customer_id.
    We have some very large summaries on this. e.g product/multiple.
    Wish to add at the summary leveks a distinct count of customers whio have been supplied or returned at these aggregate levels.
    At moment,code merges into summary tables latest batch of data on daily basis. Fine for sums, but when updating the summary table only want to read the latest batch of data, rather than having to scan the entire lower level table to get the count(distinct)
    How can we efficiently increment the counts but ensuring only increemnt if a brand new customer being supplied.
    Mat. views impractical at this stage due to volume of data.
    Many Thanks

    Hello,
    So if you have a calculation(Webi) function(Excel) built into the two tables you are using from the data source you might try 'configuring' the data as 'Occurance' from the workspace you created or after the file in index if you're using excel.  If you are using a universe as a data source for the exploration view set you can attempt to drag the 'measure' needed (count) into the workspace option "measure" when creating the workspace.
    I do hope this helps

  • Prioritizing distinct counts from aggregate table

    I am a relatively new developer with limited PL/SQL experience trying to modify an existing query that extracts counts from an aggregate table. What I need to do is set it up so that it only counts the record once based on it's priority. This is currently set up in a DECODE Statement counting only totals (not distinct nor prioritized). What I’m trying to accomplish would be something like this:
    If Service 'A' exists count it and stop. If more than one Service ‘A’ exists count only once.
    If Service 'A' does not exist then check if 'B' exist, if 'B' exists count it and stop. If more than one Service ‘B’ exists count only once.
    If Service 'B' does not exist then check if 'C' exist, if 'C' exists count it and stop. If more than one Service ‘C’ exists count only once. etc.
    It may be possible to have multiple services in a given category and if so should be counted only once.
    Here is a snipit of the existing code....
    COUNT
    (DECODE (service_id,
    1, program_enrollment_id
    ) basic_readjustment,
    COUNT
    (DECODE (service_id,
    2, program_enrollment_id
    ) occupation_skills,
    COUNT (DECODE (service_id,
    3, program_enrollment_id
    ) on_the_job,
    COUNT
    (DECODE (service_id,
    4, program_enrollment_id
    ) placement_assist
    Any help you can give would be appreciated!
    Mark

    Yes, although based on your last post, it is not quite a simple as my example. Your original query as posted will count each occurence of each service_id whether there is one or many for a group. The DISTINCT on the innermost query, against wia_bas_mv, will remove duplicates for a particular service_id, but would leave multiple records it there were different service_ids for the same group.
    The trick is to to get only one record for each group, and make sure that that record is the "highest" priority record. Since your priority order does not match the sort order of the service_ids, you need to add an extra DECODE to get them to "sort" in the right order. Assuming that I have done the service_id mapping correctly, this should be close to what you are looking for:
    SELECT region_id, region_name, officegroupname, officegroupid,
           SUM(basic_readjustment) basic_readjustment,
           SUM(occupation_skills) occupation_skills,
           SUM(on_the_job) on_the_job, SUM(placement_assist) placement_assist,
           SUM(other) other,
           SUM(basic_readjustment + occupation_skills + on_the_job +
               placement_assist + other) total
    FROM (SELECT officegroupname, officegroupid, region_id, region_name,
                 SUM(DECODE(service_id, 'C', 1, 0)) basic_readjustment,
                 SUM(DECODE(service_id, 'A', 1, 0)) occupation_skills,
                 SUM(DECODE(service_id, 'B', 1, 0)) on_the_job,
                 SUM(DECODE(service_id, 'D', 1, 0)) placement_assist,
                 SUM(DECODE(service_id, 'E', 1, 0) other
          FROM (SELECT program_enrollment_id, officegroupname,
                       officegroupid, region_id, region_name,
                       MIN(DECODE(service_id, 368, 'A', 369, 'B', 144, 'C',
                                              114, 'D', 'E')) service_id
                FROM wia_base_mv
                WHERE region_id < 13 AND
                      program_value = 'VAL04_TAA' AND
                      actual_completion_date IS NULL
                GROUP BY program_enrollment_id, officegroupname,
                         officegroupid, region_id, region_name)
          GROUP BY officegroupname, officegroupid, region_id, region_name
          UNION ALL
          SELECT r.region_id, r.region_name, og.officegroupname,
                 og.officegroupid, 0 basic_readjustment, 0 occupation_skills,
                 0 on_the_job, 0 placement_assist, 0 other
          FROM officegroup og, regions r, office_data od
          WHERE r.region_id = od.region_id AND
                og.officeid = od.office_id)
    GROUP BY region_id, region_name, officegroupname, officegroupid
    ORDER BY region_id HTH
    John

  • Converting value using lookup table

    I'd like  my query return the TRUSTID of '8' to the actual value of 'PPL' from the 'lookup_trust_table'. So instead of returning the ID of '8' from the ID field, return the value in the 'Trust_name' field.
    use database
    SELECT * FROM tblasset 
    WHERE 
    TRUSTID= ('8') AND
    dateinstalled between '2014-04-01'
    AND '2014-12-01'
    order by dateinstalled asc

    Sure for example :
    TrustID  Dateinstalled
    8              2014-04-01
    8 2014-07-01
    Desired Result 
    Trust  Dateinstalled
    PPL
    2014-04-01
    PPL
    2014-07-01

  • How to create formula with lookup table

    Hi, I would like to convert formula in the below to labview format, any idea how this could be done easiest way?
    I'm planning to use formula node but I'm not not sure about how to use lookup table inside the formula or is it even possible?
    br, Jani
            Dim dblLookUp(,) As Double = New Double(3, 1) {{4, 4}, {10, 200}, {60, 3000}, {100, 7000}}
            If dblAbsValue >= 0 And dblAbsValue <= dblLookUp(0, 0) Then
                dblk = dblLookUp(0, 1) / dblLookUp(0, 0)
                dblValue = dblAbsValue * dblk
                'lblMode.Text = 1
            ElseIf dblAbsValue > dblLookUp(0, 0) And dblAbsValue <= dblLookUp(1, 0) Then
                dblk = (dblLookUp(1, 1) - dblLookUp(0, 1)) / (dblLookUp(1, 0) - dblLookUp(0, 0))
                dblValue = dblk * dblAbsValue - dblk * dblLookUp(0, 0) + dblLookUp(0, 1)
                'lblMode.Text = 2
            ElseIf dblAbsValue > dblLookUp(1, 0) And dblAbsValue <= dblLookUp(2, 0) Then
                dblk = (dblLookUp(2, 1) - dblLookUp(1, 1)) / (dblLookUp(2, 0) - dblLookUp(1, 0))
                dblValue = dblk * dblAbsValue - dblk * dblLookUp(1, 0) + dblLookUp(1, 1)
                'lblMode.Text = 3
            ElseIf dblAbsValue > dblLookUp(2, 0) And dblAbsValue <= dblLookUp(3, 0) Then
                dblk = (dblLookUp(3, 1) - dblLookUp(2, 1)) / (dblLookUp(3, 0) - dblLookUp(2, 0))
                dblValue = dblk * dblAbsValue - dblk * dblLookUp(2, 0) + dblLookUp(2, 1)
                'lblMode.Text = 4
            Else
                dblValue = dblLookUp(3, 1) '* Math.Sign(dblValue)
                'lblMode.Text = 5
            End If
            Return dblValue * intSign
    Solved!
    Go to Solution.

    Hello janijt,
    You can definitely use formula node for it. What you would do is to create a constant array for the lookup table. 
    Here's an implementation in MathScript Node
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation

  • Reg:RadioGroup Using Loookup Table

    Hi,
    i have a problem .
    i created a radiogroup using lookup table from Aol.
    i want to get the value in ciontroler of the selected radiobutton...
    saying pagecontext.getparameter ("of thatid");
    i am not getting its value...
    can somebody help me with this....

    You can get the value in PFR using
    String radioGroupValue = pageContext.getParameter(<Radio Group Name>);

  • Distinct count of dimension business key in fact table

    In my cube I have a fact table which joins to a patient dimension.  The patient dimension is a type 2.  What I would like to do is get a distinct count of patients who have records in the fact table.   The business key in the patient dimension
    is the PrimaryMrn.  So a SQL query would look like this.
    SELECT count(distinct PrimaryMrn)
    FROM EncounterFact e
    INNER JOIN PatientDim p
    on e.PatientKey = p.PatientKey
    Is it possible to do this via MDX?
    Thanks for the help.

    If you have to distinct count an attribute in a SCD 2, you might choose between:
    Denormalizing that attribute in the fact table, and the create a classical DISTINCT COUNT measure
    Use a many-to-many approach - see the "Distinct Count" scenario in the Many-to-Many White paper here:
    http://www.sqlbi.com/articles/many2many (for both Multidimensional and Tabular
    If you use Tabular, you might want to read also this pattern:
    http://www.daxpatterns.com/distinct-count/
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • Distinct count for multiple fact tables in the same cube

    I'm fairly new to working with SSAS, but have been working with DW environments for many years.
    I have a cube which has 4 fact tables.  The central fact table is Encounter and then I also have Visit, Procedure and Medication.  Visit, Procedure and Medication all join to Encounter on Encounter Key.  The relationship between Encounter
    and Procedure and Encounter and Medication are both an optional 1 to 1.  The relationship between Encounter and Visit is an optional 1 to many.
    Each of the fact tables join to the Patient dimension on the Patient Key.  The users are looking for a distinct count of patients in all 4 fact tables.  
    What is the best way to accomplish this so that my cube does not talk all day to process?  Please let me know if you need any more information about my cube in order to answer this.
    Thanks for the help,
    Andy

    Hi Andy,
    Each distinct count measure cause an ORDER BY clause in the SELECT sent to the relational data source during processing. In SSAS 2005 or later, it creates a new measure group for each distinct count measure(it's a technique strategy for improving perormance).
    Besides, please take a look at the following distinct count optimization techniques:
    Create Customized Aggregations
    Define a Processing Plan
    Create Partitions of Equal Size
    Use Partitions Comprised of a Distinct Range of Integers
    Distribute the Hash of Your UserIDs
    Modulo Function
    Hash Function
    Choose a Partitioning Strategy
    For more detail information, please refer to the article below:
    Analysis Services Distinct Count Optimization:
    http://www.microsoft.com/en-us/download/details.aspx?id=891
    In addition, here is a good article about SSAS Best Practices for your reference:
    http://technet.microsoft.com/en-us/library/cc966525.aspx
    If you have any feedback on our support, please click
    here.
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • Distinct Count Function-how to use properly

    Hello,
    I am new to using forums & have only been using Crystal since May of 2009, so i hope i do this correctly & provide the appropriate information.  i've looked for this answer in what's been posted but cannot find it.  Some things i've read I don't really understand.  I only know how to use the functions that are in the software, i don't know how to write them myself (i think that's when people have referred to SQL code or basic syntax)
    I have CR Professional, version 11.0.0.1282 (Crystal Reports XI).
    I work at a county health dept and we have a annual medicaid cost report,  I am linking Crystal to our EMR billing module.  i have my report sorted by insurance, ie medicaid, bcbs, abw, hpm etc.  and within each ins group i have the clients ID, DOS (date of service), procedure code, charge amt, ins pmt & patient pmt.  i have totaled the charges & pmts for each group-works fine.  i even have been able to create the formula to adj out the duplicate entries in the billing module (a service was entered wrong then adjusted out then re-entered correctly-without my formula crystal was pulling both these records and adding them to total charges.)
    Where my problem lies and what my question is:  I need to count encounters, an encounter is the visit, but each visit could have 2 or more procedure codes.   So this results in multiple lines on my report for one visit, which i want for the charges to add correctly, but it makes my visit count to high. So I read about the distinct count function, of which there are three listed & i'm having a hard time understanding the differences.  What i tried is: a distinct count of the acct ID-so the same acct ID's are only counted the one time.  But some clients see us more than once per year, meaning the acct ID is the same but the DOS is different.  For this client that would be 2 visits.  But crystal is counting this as 1.
    Saying what i want to do is this:  Count as 1 when the acct ID and DOS are the same.  I've tried using the different distinct counts but when i check my formula it always has errors.  So I'm sure my lack of knowledge is what's holding me up-i fully believe crystal can do this.
    Any help would be greatly appreciated.

    I create a dummy table, set up acc_id and DOS and Charge.
    Created a running total
    Summarized acc_id
    Type of summary Count
    Evaluated using a formula
         <> previous ()
    and reset on ACC_ID
    My groups were sorted by acc_id and date
    where there were multiple visits on the same DOS my count was 0
    where the dos changed it would count accordingly.
    You may need to use two Running totals to get the complete picture.

  • Count records in table where fields not used in Report

    Hi
    I was wondering if anyone could help me with a problem I have. I am new to Crystal Reports... I am using CR2008 and XSD as a datasource.
    I have the following tables used in the report.
    Programme Table          Risk Table          Control Table          Test Table
    ID               ID               ID               ID
    Name               ProgrammeID          RiskID               ControlID
    Details               Description          Description          Description
    Opinion               Notes               Notes               Notes
                   Risk Recs Table          Control Recs Table     Test Rec Table
                   ID               ID               ID     
                   RiskID               ControlID          TestID
                   Description          Description          Description
    In the report that I have to design, I need to display the Notes from each of the Risk, Control and Test tables in hierarchical order and also display the notes when there are one or more recommendations attached to each Notes.
              Risk Notes     - Display only when risk rec count <> 0
              Control Notes     - Display only when control rec count <> 0
              Test Notes     - Display only when test rec count <> 0
    So far I have designed the report as follows:
    I have grouping around the Risk Notes, Control Notes and Test Notes as
         Group 1 - Group by ProgrammeID
         Group 2 - Group by RiskID
         Group 3 - Group by ControlID
         Group 4 - Group by TestID
    (This is giving me the notes in the order that I want)
    Since I want to know if each of the risk, control and test have got any recommendations, I created summary counts to get the recommendation count for Risk, Control and Tests. But I am not able to get the right count. Effectively, what I need to do is go through the Risk Recommendation table and count the recommendations that belong to that particular RiskID. If the count = 0 then I want to supress the Risk Notes (Group Header 2.)
    Can anyone suggest how to get the count?
    Thanks

    Hi
    I am using Distinct Count.
    When there are no recommendations then the count always comes out as 1 and the count is correct for the first grouping. After that even if there are more than one recommendation, the count is always 1!
    How do I reset a summary count?
    I even tried writing a formula to do the count..
    NumberVar riskCount;
    WhilePrintingRecords;
    riskCount := DistinctCount ({RiskRec.ID}, {Control.RiskID})
    and another formula to reset this count, even then the count is still coming out incorrect. It brings a value 1 when there are no recommendations and the count is right for one set of grouping only.
    I have just recently started using CR and havent quite mastered it yet!
    Thanks...

  • Report using Tabular Model and Measures based on Distinct Counts

    Hello,
    I am creating a report that should present something like this:
    YEAR-1 | MONTH-1 | MONTH-2 | MONTH-3... | YEAR | MONTH-1 | MONTH-2 | MONTH-3...
    My problem is that when designing the dataset to support this layout I drag the Year, Month and Distinct count Measure, but on the report when I want the value for the YEAR level I don't have it and I cannot sum the months value...
    What is the best aproach to solve this? Do I really have to go to advanced mode and customize my MDX or DAX? Can't basic users do something like this that seems so trivial and needed?
    Thank you
    Luis Simões

    Hi Luis,
    According to your description, you create a Reporting Services report using Analysis Service Tabular Model as the datasource, now what you want is sum the months value on year level, right?
    In your scenario, you can add the Month field to column group, add a parent group using Year Field and then add a Total on Month group. In this case, Reporting Services will sum the months value on Year level. I have tested it on my local environment, the
    screenshot below is for you reference.
    Reference:Lesson 6: Adding Grouping and Totals (Reporting Services)
    If this is not what you want, please describe your dataset structure, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Proper use of a Lookup table and adaptations for NET

    Hello,
    I need to create a few lookup tables and I often see the following:
    create table Languages
    Id int identity not null primary key (Id),
    Code nvarchar (4) not null,
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageId int not null,
    Title nvarchar (400) not null,
    insert into Languages (Id, Code, Description)
    values (1, "en", "English");
    This way I am localizing Posts with language id ...
    IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?
    So instead I would use the following:
    create table Languages
    Code nvarchar (4) not null primary key (Code),
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageCode nvarchar (4) not null,
    Title nvarchar (400) not null,
    insert into Languages (Code, Description)
    values ("en", "English");
    The NET applications usually use language code so this way I can get a Post in English without using a Join.
    And with this approach I am also maintaining the database data integrity ...
    This could be applied to Genders table with codes "M", "F", countries table, transaction types table (should I?), ...
    However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.
    And know it is even possible to map to Flag Enums so have a Many to Many relationship in an ENUM.
    That helps in NET code but in fact has limitations. A Languages table could never be mapped to a FLags Enum ...
    ... An flags enum can't have more than 64 items (Int64) because the keys must be a power of two.
    A SOLUTION
    I decided to find an approach that enforces database data integrity and still makes possible to use enums so I tried:
    create table Languages
    Code nvarchar (4) not null primary key (Code),
    Key int not null,
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageCode nvarchar (4) not null,
    Title nvarchar (400) not null,
    insert into Languages (Code, Key, Description)
    values ("en", 1, "English");
    With this approach I have a meaningfully Language code, I avoid joins and I can create an enum by parsing the Key:
    public enum LanguageEnum {
    [Code("en")
    English = 1
    I can even preserve the code in an attribute. Or I can switch the code and description ...
    What about Flag enums? Well, I will have not Flag enums but I can have List<LanguageEnum> ...
    And when using List<LanguageEnum> I do not have the limitation of 64 items ...
    To me all this makes sense but would I apply it to a Roles table, or a ProductsCategory table?
    In my opinion I would apply only to tables that will rarely change over time ... So:
        Languages, Countries, Genders, ... Any other example?
    About the following I am not sure (They are intrinsic to the application):
       PaymentsTypes, UserRoles
    And to these I wouldn't apply (They can be managed by a CMS):
       ProductsCategories, ProductsColors
    What do you think about my approach for Lookup tables?
    Thank You,
    Miguel

    >>IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?<<
    Not necessarily. The choice to use, or not to use, a surrogate key in a table is a preference, not a rule. There are pros and cons to either method, but I tend to agree with you. When the values are set as programming terms, I usually use a textual value
    for the key. But this is nothing to get hung up over.
    Bear in mind however, that this:
        create table Languages
          Id int identity not
    null primary key
    (Id),     
          Code nvarchar (4)
    not null, Description nvarchar
    (120) not
    null,
    is not equivalent to
        create table Languages
          Code nvarchar (4)
    not null primary
    key (Code),     
          Description nvarchar (120)
    not null,
    The first table needs a UNIQUE constraint on Code to make these solutions semantically the same. The first table could have the value 'Klingon' in it 20 times while the second only once.
    >>However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.<<
    This was going to be my next point. For that case, I would only change the first table to not have an identity assigned key value, as it would be easier to manage at the same time and manner as the enum.
    >>. A Languages table could never be mapped to a FLags Enum ...<<
    You could, but I would highly suggest to avoid any values encoded in a bitwise pattern in SQL as much as possible. Rule #1 (First Normal Form) is partially to have 1 value per column. It is how the optimizer thinks, and how it works best.
    My rule of thumb for lookup (or I prefer the term  "domain" tables, as really all tables are there to look up values :)), is all data should be self explanatory in the database, through data if at all possible. So if you have a color column,
    and it contains the color "Vermillion", and all you will ever need is the name, and you feel like it is good enough to manage in the UI, then great. But bear in mind, the beauty of a table that is there for domain purposes, is that you can then store
    the R, G, and B attributes of the vermillion color (254, 73, 2 respectively, based on
    http://www.colorcombos.com/colors/FE4902) and you can then use that in coding. Alternate names for the color could be introduce, etc. And if UserRoles are 1, 2, 3, and 42 (I have seen worse), then
    definitely add columns. I think you are basically on the right track.
    Louis
    Without good requirements, my advice is only guesses. Please don't hold it against me if my answer answers my interpretation of your questions.

  • Static and small dimension table should I use lookup

    Hi Gurus,
    I am creating interface to load my fact table.
    Generally for different codes to replace with surrogate keys I use dimension table for look-up in interface.
    but I have question if dimension table is very small and has only static values like
    Sur_key, Code, Description.
    1, C, Create
    2 , R, Redeem
    in such case if in interface for fact table, I just write expression "if source_table.column=C then 1 else 2".
    Please advice if this is better way or not.
    Thanks in advance.

    I agree - it is much better practice to use lookups to populate surrogate keys. Using hard-coded values in code requires the developer to always remember that dependency on dimensional data and can cause unexpected results down the line if the keys are updated or are inconsistent across environments.

  • Use of lookup table in obiee 11g

    Hi All,
    I am working on OBIEE 11g RPD.
    Under BMM layer, when select logical table and go to there properties, In general section we have lookup table check box.
    what is use of that lookup table check box in obiee 11g.
    Thanx and Regards
    Prashant

    Please go thru this blog...nice explanation on Look up tables - new functionality in 11g
    http://www.rittmanmead.com/2010/08/oracle-bi-ee-11g-lookup-tables-sparse-and-dense-lookups/

Maybe you are looking for

  • Should I send my whining MacBook to repair or exchange it?

    I have a week 12 MacBook Pro 1.83 that has the horrible whine other people on this forum have described. It only happens when running on battery power, and goes away either by opening PhotoBooth, the Mirror widget, or plugging into AC power. Changing

  • Managed Bean Help for Definition Help

    I am working on creating Managed Bean Help for Definition Help as described in ‘19.5.3 How to Create Managed Bean Help’ section of the Web User Interface Developer's Guide fpr ADF. Using JDev Version 11.1.2.1.0. Thought I had all the artifacts assemb

  • Resizing Swf at runtime based on content

    Hi I am working on a project and I am trying to figure out how to resize the swf at runtime based on the content (which is brought in by xml) .  What I am trying to do is similar to http://www.mustardlab.com/developer/flash/objectresize/  but unfortu

  • Where is it referencing its music from?

    Hi Anyone know where IDVD 6.4 is referencing music for its themes from? I want to use a piece in another program. the only link I can see to the music is where it says "edit drop zones" there is a music icon there but I cant seem to find any more inf

  • In which IDOC we wil get infotype 0210

    hi experts, i have to use infotype 0210 in my project. Does any body can tel in which idoc we wil find the infotype 0210.