Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Can we write select statements in rpd

Received Response
191
Views
32
Comments
24

Answers

  • ForSly
    ForSly Rank 5 - Community Champion

    Yes, my rpd is modeled as per business requirements. and my query is on the database is "SELECT count distinct  A_FLAG, Number FROM  B_FACT" I am using distinct to eliminate extra rows / duplicates. in the rpd I just  set aggregation rule for A_FLAG  as  count distinct but I don't have an option or a way to group it by what I would want in order to get a correct result.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Sincere thanks for providing company / moral support on this one...

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Can you tell me where the 3 elements site i.e.

    Flag (1 / 0) = fact

    Employee = dimension

    Job = dimension

    Correct me if I am incorrect please as to the source of the three?

  • ForSly
    ForSly Rank 5 - Community Champion

    That's correct

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    re: grouping

    If your attributes are on dimensions then they ALWAYS group - unless you are using a non-aggregating measure!!

    So if your measure is count distinct 1, and you pull in Job and Job Group and you filter on the job then you get the equivalent of; -

    select count distinct flag, job, job_group

    from whatever

    where job = 12345

    Group by

               job, job_group

    This is true unless there is something badly wrong with your rpd - which is mine and @Gianni Ceresa suspicion.

    Note the above assumes count distinct flag is measure in your fact table and everything else is in dimensions.

  • ForSly
    ForSly Rank 5 - Community Champion

    This is correct (select count distinct flag, job, job_group

    from whatever

    where job = 12345

    Group by

               job, job_group) and basically  I am wanting or trying to figure out how I can get my   counts in the rpd / analysis by using something like this.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    It should happen automatically just by pulling the measure / dimension attributes into the analysis - IF you have the attributes in dimensions AND the measures in the FACT folder - if not then there is something badly wrong with your subject area and you really need to redevelop it, it is just plain wrong.

    Not sure how else I can say this, or help you, as you continually do not answer my questions on the underlying structure of your subject area.

  • ForSly
    ForSly Rank 5 - Community Champion

    What question I didn't answer ? I will be more than happy to answer any question that can potentially point me in the right direction

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Which of; -

    flag

    job

    job_group

    Come from a fact table, which from a dimension?