OBIEE advanced SQL filter - obiee

Good morning! What would be the best way to filter an analysis off of an Essbase subject area based on the value of a prompted presentation variable? For example, if the user selects the "Widgets" parent entity it would display its direct children as rows in a table view. There would be 6 or so different choices that would all have different children. Would a CASE statement work?

Related

How to access categories in Wix Database

I've been struggling to create a repeater which accesses specific information in my Wix data base. My question is a bit more complex than connecting the repeater to a column.
Rather, I want the repeater to access types of data within a column on the database. I have a column in the data base with an id, "category". For illustrative purposes, say the name of the data base is "store". I'm selling two different types of shirts. Some are casual, others formal. "category" has twenty iterations of both "formal" and "casual". If I create a repeater which accesses "category" and displays its text, I'll end up with a repeater forty iterations long. Instead, I want to parse out how many types of categories there are (in this case, two: "formal" and "casual") and only to display each category once-- a repeater which is only two iterations long.
(I know Wix has the ability of accessing how many types of information there are in column "category", I just don't know how to actualize on that ability. I know Wix has this ability because you can create a dynamic item page with a url of name "category". This will create a page for each category in "category". How do I do the same thing but for a repeater?)
One way to accomplish this is by using the Wix Data API Distinct query and then using the query result as the data for your repeater. This means you would not use the GUI connect to dataset, but the code in the page's IDE. Once the query returns, you can set the data property of the Repeater and then use the onItemReady() function for any further manipulation you may need.

Cognos Report-need 2nd (Totals) Crosstab that is "aware" (filters) using the current Grouping

I am trying to create a report which groups on a column called "Legal Entity." When the output is directed to Excel, a separate tab will be created for each distinct entity in the query resultset.
For each Excel tab/Legal Entity, there will be two "sections." The first is a repeating section that breaks on a column "Funding Arrangement Type." After all of the Funding Arrangement Types are exhausted, there will be a single "Totals" grid which will summarize the data on the tab for the current Legal Entity. The data will be summarized across all Funding Arrangement Types within the current Legal Entity.
Because the Totals (lower) grid is really just a summarization of the same source query, Query1, I thought that I would also bind the Totals grid to it. However, if I do that, I get a run time error that tells me that I need to establish a Master-Detail relationship (If I decide to use a separate query for the Totals grid, the Totals grid "will not be aware" of the current Legal Entity/tab that must be considered when summarizing.)
Therefore, I continued with my guess at how the Master-Detail relationship should be defined. I made various attempts to link the two grids, including:
On all of the dimension (non-summarized) columns.
On Legal Entity
On Legal Entity and Funding Arrangement Type
Doing so affected previously correct totals reported in the upper cross tab results/
This Master-Detail approach is foreign and as a result I don't understand what it is doing.
I also tried to use a separate query, Query2, for the lower totals grid and adding a filter to filter SQL2 where SQL2. LegalEntity = SQL1.LegalEntity in an effort to get the totals grid to summarize within the current LeglEntity grouping. This resulted in a cross join error.
I’m a real noob with Cognos. Suggestions are welcomed. Thank you!
You can use mouse+scroll wheel to zoom in:
I was able to get it working by binding both grids to a single query and for both grids, establish a Master-Detail Replationship on Legal Entity. Prior to doing that, I added these columns to both grids and hide them, not sure if this was necessary.

Surely Salesforce supports regular old grouping and summarization in reports?

So the reporting system in Salesforce is a bit restricting. It seems there is no editor for an xml or other markup language to create reports in; apart from formulas you're stuck in the website drag and drop ui.
There seems to be 3 types of reports in Salesforce Tabular, Summary and Matrix. The first kind is kind of useless for more advanced reports, since it doesn't support forumulas (if both fields are in the same table you can work around this with calculated fields). However with all 3 I've found it difficult to impossible to make a report with basic details and summarized figures.
An example:
I've added a custom field "company size" to the Account table/object. This tracks the approximate number of employees working at the customers company (ever taken one of those surveys that asked you for a range of how many employees worked in your organization). I then have a custom table/object for sales, listing the account, the date and the volume ($).
I would think it would be a simple to create spreadsheet style report with each row listing an account, which state it was based in, how many employees they had, followed by their total sales and sales/employee (a formula of volume/employees).
But the grouping and summarization options don't seem to work that way. Grouping in both the Summary and Matrix report types seems to want to treat each grouped field as a seperate level, so with the 3 fields related to the account I get 3 cascading fields in a stair like arrangement, instead of being able to put them on one row.
It gets worse with the summarization - no matter what I and other colleague have tried the summarization doesn't seem to work. If an account has 50 sales we end up with 50 rows, even if we click the little arrow beside the column, click summarize and check Sum.
From an SQL perspective this report seems like something you would teach students in the first week, yet its really not obvious how translate this into something Salesforce can understand. A lot of the web ui is not discoverable (dragging fields provides no feedback as to why it can't be dropped in a particular place, some options are hidden unless you hover the mouse over the right place) so I would not be surprised if I've missed a crucial step.
So, is there an option to make this work (particularly getting sales to be totaled as a single cell for each account, not 2 or 5 or 50), maybe a distict checkbox lurking behind an innocent blank area?
Given the lack of calculated fields in the report, you need to create the formula at the object level. If it's not useful in the detail page, don't include it in the page layout. It will still be available in reporting.
The summarization/grouping options work as in SQL, but you can only group by one field at a time.
However, the result view in "show details" mode is not like a simple SQL query - more like using windowing functions where the result output can contain both groupings with aggregations at those levels, and the detail rows that fed into that grouping.
In "hide details" mode, the detail rows are not shown, and so only grouping levels and the aggregates are shown.
So, it looks like you can either:
group by state, then account, sum your employees, sum sales, and then a Custom Summary formula of sum:sales/sum:employees
or
create a formula field on account to do sales/employees
tabular report with fields of: account, state, employees, sales, your new field.
Also, if you want an XML editor, you can edit the XML for reports (as with many other parts of salesforce setup) via the metadata API and the force.com plugin for eclipse. But it's mainly for tweaking reports, or version control, or mass-actions, as there is no preview/run operations, it's mostly a metadata management system.

FileMaker Pro -- Filtering Relationship Not Working

I'm trying to build a FileMaker Pro 11 layout that excludes records containing a certain value. The relevant data is in table Invoice. I want to filter so that Invoice records whose "Invoice Check Grouping" field is blank are not displayed on the layout.
I've added a global field to the invoice table called "Blank Invoice Check Grouping" to use as my filter criteria. I've created a self-join relationship to the Invoice table, joining "Invoice ID" to "Invoice ID" and joining "Invoice Check Grouping" to "Blank Invoice Check Grouping". The resulting table is named "Invoice Check Groupings".
The layout which I build based on table "Invoice Check Groupings" shows all records in Invoice--it does not filter out those with blank values. What am I doing incorrectly?
Thanks,
Ben
Layouts show records in a table (or more accurately, a table occurrence) and don't directly deal with related data. As mentioned by #pft221, you can use relationships for filtering, but only when viewing data through a portal.
If you always want a particular layout to show data based on a particular find, you can do so with a script and a script trigger. First set up a script to do the following:
Enter Find Mode[]
Set Field["Invoice Check Grouping"; "*" // Find all records with any data in this field
Perform Find[]
Note that you can also embed the find request within the Perform Find script step, but I tend to script finds in the above manner as it's easier to see what the find request is in the script and variables can be used in the find request.
Now you need to set your layout to execute this script whenever it's loaded. Go to the layout and enter Layout Mode. Select Layouts>Layout Setup from the menu bar. Click the Script Triggers tab and check the box for OnLayoutEnter and select the script you wrote above. Now whenever the layout is entered, that script will run and exclude the records that have that particular field being empty.
There are many ways to filter records, depending on what you are trying to do and what you are trying to display for your users.
The most common and simple way you can filter records is through a simple Find in a list view. I'm unclear from your question, but my best guess is that you're already using a list view and misunderstanding how FileMaker's relationships and Table Occurrences (TO's) work.
To Filter with the "Find Records" method:
Create a new List View layout of any Table Occurrence of your Invoice Table -- most likely you will want to use the default Table Occurrence that FileMaker created for you when you created the table.
Place the fields that you would like to display on that layout, including the "Invoice Check Grouping" field.
Switch into Find Mode
Put a '*' character into the "Invoice Check Grouping" field
Perform the Find
You should now see a list of all Invoices where the "Invoice Check Grouping" field is not blank. (You can find additional interesting search criteria in the "Insert: Operators" drop down of the title bar.)
Now you may actually be looking to filter related records through a portal but, given that you've set up a self-join on the Invoice index on the Invoice table my guess is that, at best, this would show either 0 or 1 record for each Invoice record you display in your main layout.
To Filter Records with the "Portal Filter" method:
Let's assume, though, that you have a Client table where you'd like to see only the records with a non-blank "Invoice Check Grouping" value. The table set-up would be as follows:
Client
Client ID
[... other client info ...]
Invoice
Invoice ID
Client ID
Invoice Check Grouping
[... other invoice info ...]
With a relationship in the relationships graph:
Client::Client ID ------< Invoice::Client ID
From there you would set up a Form layout on the Client TO and create a portal showing records from the Invoice TO. From the options for the portal you would select "Filter Portal Records" and use a formula similar to:
not IsEmpty(Invoice::Invoice Check Grouping)
Finally, it's worth noting that a portal filter isn't appropriate for all display situations or calculations. You can set up a similar filter completely through your relationships graph (as I believe you have already tried to do.) This will work, once again, for viewing records through a portal but not for the records displayed by a layout itself.
The answers above don't actually help Ben with his question. They are workarounds.
I have the same problem as Ben, and I don't think there is a solution, even now in Filemaker 12. There is I think no way to define a relationship that will omit the related records where the match fields are empty.
Two options come to mind:
On a specific layout, you have more fine-grained control in the portal definition itself, and can use this to exclude the records
You can now use SQL queries to achieve this result within Filemkaer.

database driven form controls

How to do databse driveen jsp page,
Suppose i have 5 text fields,if user wants to put one of the form field as select box.JSp should identify and return the select box if it define in db as select box.
I dont know how to achieve this,can anyone suggest this.
Regards,
Raju komaturi
There are multiple tasks if you want to do this completely. The world at large has not gone this way and so there are not many tools (if any) for this. But basically here are the main ideas.
1) You want a "data dictionary", a collection of meta-data that tells you what the types and sizes of each column are, and the primary and foreign keys are.
2) For your example of "knowing" that a field should be a drop-down, this almost always means that column value is a foreign key to another table. Your code detects this and builds a listbox out of the values in the parent table.
3) You can go so far as to create a complete form generator for simple tables, where all of the HTML is generated, but you always need a way to override this for the more complex forms. If you do this, your data dictionary should also have column descriptions or captions.
There are many many more ideas, but this is the starting point for what you describe.

Resources