OBIEE remove dimension value based on measure result - obiee

One of my dimension contains the different divisions of the company. I have one division which doesn't exist anymore but I want to keep this to check the results of previous years and months.
How do I dynamically eliminate this value of the dimension when it doesn't have a measure anymore?
First I was thinking that adding a filter where the measure should be > 0 or 'not null' but this doesn't seem to do the trick. The dimension keeps showing up.
Thanks!

To go a bit into more details on Robin's question which is the most pertinent one:
Do you try to remove the "obsolete" dimension member from dimension-only queries - like prompts for example?
This is crucial to know as forcing a normally dimension-only query over a fact and thus continuously forcing the inclusion of the fact table for all queries potentially has quite a performance impact.
a) ">0" and "is not null are two completely different things and if used in a cavalier fashion can also yield absolutely wrong results. What if the measure is at a negative value? That would make it "disappear" as well for you. What if there simply is no measure yet but the dimension member is implicitly actually valid just not filled yet? That would also make it disappear for you.
b) How can you know the point of view a user is standing at? For an analysis run for last year this will be perfectly valid to show?
c) What about time-variant comparisons? What about rolling calculations?
d) What about the point-in-time of the dimension rather than the fact? --v
e) What about cross-org analysis like "What do our numbers look like when we apply last year's org vs this year's vs a planned new one which is already loaded into the data source?
While I understand the idea behind your question you should not forget that we're talking analytics here and always face changing dimensions and attributes so your request which seems valid from a human point of view for that one, specific use case is - for the solution as a whole - to be considered wisely.

Although I'm not clear on what you mean by "eliminate this value of the dimension", I think you may be looking for the pivot measure function, called FILTER(Fact USING (Insert your filter here)).
I am assuming that when aggregating using a measure, your problem is that you are unable to exclude the Division that does not exist anymore, and as a result, your measures/aggregations are incorrect.
In this case, you should use the pivot measure as I indicate above.
Your column formula would look like this:
FILTER(Measure1 USING ("SubjectArea1"."Division" <> 'DivisionName'))
Follow these steps to implement this function:
Edit the column formula of your measure.
Highlight the formula of the column and click the Filter... button at the bottom of the Column Formula text box. An Insert Filter window will appear.
Select the Division column from the Subject Areas pane. (Either double-click it, or select it then click the OK button).
You will see a New Filter window. Change the Operator to is not equal to / is not in.
Select your Division that you want to exclude.
Click OK to close the New Filter window.
Click OK again to close the Insert Filter window.
Click OK again to close the Edit Column Formula window.
If your syntax is correct, you will see no errors.

Related

Add fields and query manually to existing single group layout

I already have a group called G_1 in my report and the entire fieldset required for the report are present in G_1.
Now, I have a new requirement which needs data from different tables and hence I created a new query using "Data wizard" and a group called G_2 was created as well.
I don't want to affect the layout of the existing report(every field is in a single repeat frame) and wanted to add my new fields as well
I added fields and mapped the data, but then I got error saying "field references column below its group frequency"
So I have to bring the column under the existing group G_1 without using report wizard.
Any leads would be of big help!
If I understood what you are saying, that won't work.
If you created a new query, it has its group (G_2) and fields selected within that query have to belong to G_2 group. In Paper Layout, by default, every query has the outer frame (M_2), it contains a repeating frame (R_2) and fields have to be part of those frames.
If you set flex off and confine off (so that you could drag fields here and there, even out of its boundaries (frames) and actually do that - drag a field to, say, R_1 frame (which is part of M_1 which belongs to query 1), you'll get that error.
So, what to do?
If possible, the simplest option would be to adjust query Q_1 and add those new fields in there. If not, you'll have those two queries.
One option is to put query 2 objects (frames, fields) below the ones that belong to query 1 (so that they are unrelated). Another is to stretch query 1 frames "down" and make space for query 2 objects. Then you'd draw a M_2 frame (paint it white so that you can easily see what's going on). Within M_2, draw a repeating frame R_2 and paint it yellow. It has to be contained in M_2. Now, create the first field within the R_2 repeating frame. Check the Object Navigator - everything has to be in its place. If it is not, you'll have to move objects backwards (or forward).
Run the report - if it works OK, fine - go on to the next field, and so forth. Test frequently. Once you're done, make it prettier - move everything to its right place, remove painting and - that's it.
On the other hand: as there's only one frame you currently have (I don't know how many fields there are and how complex the layout is), if you are an unexperienced Reports user, your best option is to delete current layout and let the Wizard do the job. It'll certainly ruin everything you've done so far, but it has its advantages - all objects will be on their proper places. Might be time consuming, but adjusting fields and headings and stuff could be simpler and easier.
Unfortunately, there's no easy way to do it. Takes time to gain experience, but - if you have it - go for it. How will you learn how to do it if you actually don't do it?
Best of luck!

Filter Data for Each Row in a Column

EVE Online Manufacturing Spreadsheet
In Batch!F3:G, I'm attempting to break down the data input from columns B3:C to their components (and eventually materials/minerals in I3:J) by using filter to compare results in Engine!P:R. Multiplied of course by the total number of each finished product I need.
I've been trying to figure out ways to arrayformula this together, and even tried quite a few query functions without success. The best I've been able to come up with is to string the actual formula together, appending them with {}, but this gets bloated quickly. I need this to be open ended because I have a tendency to build a lot of things at once. Any help would be appreciated, even just point me in the right direction!
Well, based on my limited knowledge about google sheet, I can only think of one way to do this automatically.
Here's a sheet I constructed based on your sheet.
https://docs.google.com/spreadsheets/d/1AfX8o05gUGPiN5S90w4o0yxuIYjsJRaXsaYUFTJuEPo/edit?usp=sharing
First, on Engine sheet, add one more column which will give you the number of materials required for that part, which is looked up in the PART LIST of BATCH sheet. For this I use VLOOKUP, as you see in D2.
Then on BATCH sheet, query the materials that VLOOKUP return positive, multiply it by the amount of item and then sum them.
This is done by the QUERY used in F3
This method only if you don't have duplicate item in your PART LIST, due to the way VLOOKUP work.
Of course if you want to break the material list further, you can do the same approach..

How to conditionally require 18+ fields based on selection of two dropdowns

I'm new to Sharepoint 2010 with what I would call a highschool freshman level of coding experience, though I can generally stumble and tinker my way through. I don't currently have access to Sharepoint designer, but from the searching I've done so far, it may required. Still I'm hoping to find an OOTB solution to the problem below.
I have been tasked with building a incident resolution tracking sheet on Sharepoint. My boss is very concerned with being audited by legal, and has some very specific requirements about required information. Column A contains a drop down list of 5 choices that indicate the Final Solution. Column B Contains a drop down list with 4 choices that indicate the Initial Problem. Based on The selections in A and B, different Columns in C-X are required to be blank, not blank, or contain specific entries. The only way I can find to do this is to create a list validation containing a nested if for each combination of A and B resulting in 20 nested ifs. However sharepoint is limited to 7 nested ifs, so I'm looking for any possible solutions.
*This List will primarily be accessed in Datasheet view, so "HTML in calculated column" type solutions are not viable.
You can use calculated columns to break up the validation formula into more manageable chunks.
Let's start with a simple example.
Condition 1: If the initial problem was that the user's computer was too slow and the final solution was restarting the computer, you need to fill in the [C] column.
Condition 2: If the initial problem was that the user was on fire and the final solution was dousing them with water, you need to fill in the [D] column.
You could perform that list validation all in one formula, as below:
=IF(
AND([A]="Restarted Computer",[B]="Computer is slow"),
NOT(ISBLANK([C])),
IF(
AND([A]="Doused with water",[B]="User is on fire"),
NOT(ISBLANK([D]),
TRUE
)
)
But that's long and ugly (especially when you condense it to one line).
Instead, you could add two calculated columns, one for each condition you want to check. For the sake of this example, let's say you add a column called C_is_valid and a column called D_is_valid:
C_is_valid calculated column formula:
=IF(AND([A]="Restarted Computer",[B]="Computer is slow"),NOT(ISBLANK([C])),TRUE)
D_is_valid calculated column formula:
IF(AND([A]="Doused with water",[B]="User is on fire"),NOT(ISBLANK([D]),TRUE)
Updated validation formula:
=AND([C_is_valid],[D_is_valid])
It's easy to see how this can simplify even a very complex set of validation conditions...
=AND(C_is_valid,AND(D_is_valid,AND(E_is_valid,AND(F_is_valid,AND(G_is_valid,AND(H_is_valid,I_is_valid)))))
But even that could be simplified by consolidating some of those AND()s into multiple calculated columns, so that your final validation formula could be as simple as:
=AND([First set of conditions is valid],[Second set of conditions is valid])

Is it possible to reverse a column transformation in Spotfire, and if not, what are the alternatives?

I've made the mistake of using the 'Calculate and Replace Column' feature to replace the wrong column, and realized after the fact. The column I replaced corresponds to last names and is important. I would like to retrieve this column but maintain my other 15 or so data transformations. Ideally, I would like to remove this transformation, but I've come up empty so far. Here's what I've tried:
I tried adding the 'last name' column again from the same external source, using >Insert >Columns... I also tried renaming this column to avoid the data transformation. Unfortunately, this resulted in an entirely empty column, so it did not successfully match to the table or was affected by the transformation..
I checked the source information, and found exactly the 3-4 lines that I wish were not there. I thought it might be possible to edit this but haven't found a way. This seems like it would be the easiest.
Another idea I had was I could replace the data table with the same source, and repeat all of the transformations from the replace data table dialogue (excluding the bad one). This is my next plan of attack, but I figured I would come on here to see if there's an easier way first.
Thanks in advance!
Good News for YOU!!! #jeremyVollen.
It is possible to 'edit' your transformation per Tibco article 44098.
Resolution: If there are more then one transformations on a data table and you need to edit any of those transformation, follow the steps below:
Go To Edit >> Data Table Properties.
Select the desired data table inside which the transformation has been added and click on Refresh Data > With Prompt.
A new window will pop up which will allow you to make the desired changes in each of the transformations.
unfortunately it is NOT possible to reverse data table transformations.
it IS possible to undo the transformations with Edit>>Undo or CTRL+Z, but that's as far as it goes.
my strategy for dealing with this is (in accordance with your #3) to visit Edit>>Data Table Properties, select the table I'm interested in, select Source Information, then copy the contents of the textarea and paste it into notepad. then, I'll File>>Replace Data Table and start over from the beginning while keeping the notepad open so I don't miss any steps.
I realize it's not ideal, but there is unfortunately not another way.

Calculate Value For Dates Between

A few references:
Microsoft's documentation on DATESBETWEEN.
Somewhat similar question, though the answer and derivatives of the formula don't return the correct results.
Microsoft's documentation on TODAY
Per the above Microsoft documentation, I'm trying to get a calculation for the last three months based on today's current date in SSAS Tabular model. First, I have no idea how to use SSAS and my company doesn't provide any learning material, so I've been reading through the MSDN documentation, which may not be the place to start, so if this is wrong, I'd appreciate being told so. For instance, with C# or Ruby, I can test code in a console to see if I get the result that I want, and I don't see how I can do that in SSAS Data Tools' DAX language - this is a GUI which gives users very little power over what they can do (it took me four hours to figure out how to access a dimension's properties). I am definitely a code monkey.
I tried using the below formula (and derivatives of it) because this is what it looks like Microsoft is doing in their example:
3MonthValue:=CALCULATE(SUM([MeasureOne])/SUM([MeasureTwo]),DATESBETWEEN(DateDimension[Date],DATEADD(DateDimension[Date],-3,MONTH),TODAY()))
The result, nothing. Of course, if I run similar SQL logic, I get the right results. I also used the provided SO example, though I suspect that's not exactly what I'm trying to achieve, and only obtained blanks as answers. Given that I need to calculate a formula between a certain time frame, which in SQL would be the WHERE clause, how do I translate this into DAX? In other words, what is DAX's WHERE and if CALCULATE isn't right, what's the correct approach?
When you say it isn't working, how do you mean? The formula you are using refers to your date dimension's key as the starting date for your DATESBETWEEN function - this means if you are expecting the measure to populate a value, you'll need to be using a particular date in your pivot to establish context.
If you are trying to view the measure at design time, in the editor, there is no context so the measure wont populate.
Moreover, if in a pivot you're looking at a time context that includes more than one date, that also will not work. So say you are looking at a month, or a quarter. Both of these encompass what amount to multiple DateDimension[Date]'s - so again context cannot be established.
so to recap - measures which look at date ranges like DATESBETWEEN using a starting time context that is set to your dimensions time key will only show up in a pivot when the pivots data is filtered to a single date.
You can test this using the same function, but hard set the starting date by replacing DateDimension[Date] with a static date (or possibly TODAY()). The measure should show up in design time because the formula has all the information it needs to complete the calculation.

Resources