Oracle Transactional Business Intelligence

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

OTBI Logical SQL complex query assembler

Received Response
739
Views
14
Comments

Summary

Combine 2 analyses from 2 different subject areas

Content

While building a report on OTBI, you will encounter some cases where the Subject Area will only provide you partial information, and you need to complete that data with some others which are located on an entirely different Subject Area.

Sometimes, even within the same subject area, the biais arbitrarily taken by OTBI when selecting some columns will render no results because of the joins decided by people creating the subject area columns are not compatible or are reporting on 2 realms that cannot communicate together (for example, getting some course related info and offering related info at the same time from the learning subject area).

In short: you have 2 analyses which work perfectly fine on their own, but you have no way to combine them together to work it as a single comprehensive report.


The attached spreadsheet will guide you to associate these 2 analyses by making you follow several easy steps:

  1. On each of your working analyses, you need to pick up the generated SQL by going into the Analysis "Advanced" tab, and copy the "Generated SQL"
  2. Paste both these SQL on the "Base Query" Tab as indicated in the example.
  3. Give a name to your columns
  4. This spreadsheet need to identify the 2 separate queries and assemble them in 2 different temporary tables. Give a name to these tables.
  5. Select the type of join you want on these table as well as which column from each analysis should be the common join.
  6. Pick up the final query. First paste it in a word document (so it does not pick up any doublequotes where you do not want them)
  7. Then from the Word, copy and paste it when creating a new analysis based on a custom logical SQL going into an analysis/advanced tab/new analysis button.

 

NOTES:

  • This assembler should account for specific filters present in each of the 2 queries and render them as they should be.
  • It supports up to 30 columns on each of the 2 queries
  • It will not account for any column and view formating/reordering you have already done on either of the 2 queries individually. This is just generating the basic assembled query on which you can then work to make it look better.
  • It does not account for join on multiple columns at the same time, but you can always add them manually in the query.
Tagged:
«1

Answers

  • Prudence K
    Prudence K Rank 5 - Community Champion

    I cannot wait to explore this more - thank you so much!

  • Aaron Leggett
    Aaron Leggett Rank 5 - Community Champion

    This looks awesome, writing Logical SQL manually can be a cumbersome task. Perhaps this could be turned into an app using Oracle Cloud's Free Tier + Apex? You might even be able to go as deep as creating a visual format that allows you to drag and drop the logical column names by importing the OTBI lineage docs.

    I always thought a good enhancement would be an app that allows you to insert HTML + CSS markup visually (like a lot of no/low-code tools allow you to do) to a report that auto-applies the formatting to the XML, alleviating the pain of manually editing the format for each column (import from template doesn't always work!)

  • Maxime Pignot-Oracle
    Maxime Pignot-Oracle Rank 2 - Community Beginner

    Thank you for the feedback. Likely if I had an Apex creation/edition permission somehow i'd definitely spend the time studying it. Obviously having this somewhat directly in OTBI would be awesome instead of the current join feature that actually does not work.

    When it comes to formating, that could be a next step for that spreadsheet, and issue 2 different statements, one for SQL, one for XML.

    XML would be pretty hard to parse though, because all views, ordering, formating, aggregation rules, column properties are in there. So I would have to constrict that to very simple formating option or that will be a nightmare.

  • Jagdish Varadraj
    Jagdish Varadraj Rank 3 - Community Apprentice

    Great. Can i add more Queries Like Query 3 / Query 4 to it. will the excel macro work?

    Thanks
    Jag

  • Maxime Pignot-Oracle
    Maxime Pignot-Oracle Rank 2 - Community Beginner

    hey Jag,

    I havent dwelled into that yet. If I manage to know how a query would look like i can probably adjust the parser accordingly.

  • Anders W. Langholm
    Anders W. Langholm Rank 4 - Community Specialist

    Hi.

    I have used the query assembler and I'm able to get the right result, but when I'm trying to add any prompts to the prompts-tab, it just returns the following:

    "Failed to load(Odbc driver returned an error (SQLExecDirectW).)"

    How do I figure out what is wrong, when all I am left with is this pretty generic message?

    Hope you're able to point me in the right direction :)

    Kind regards

    Anders

  • Srinivas Pendyala-Oracle
    Srinivas Pendyala-Oracle Rank 4 - Community Specialist

    Please attach the Nqquery.log file of the report.

  • Anders W. Langholm
    Anders W. Langholm Rank 4 - Community Specialist

    Hi Srinivas

    Here you go ? Thanks in advance for your help.

    //Anders


  • Marybeth Snodgrass
    Marybeth Snodgrass Rank 4 - Community Specialist

    @Anders W. Langholm were you ever able to figure out how to get prompts to work? i am having this issue too

    @Maxime Pignot-Oracle

  • CA Nirmal Choudhary
    CA Nirmal Choudhary Rank 1 - Community Starter

    Hi Marybeth Snodgrass,

    You can dashboard prompt -

    1. Make column filter as prompted
    2. Create Dashboard prompt with same column
    3. add both of them in dashboard page