How to strip off the first word from a measure being selected in a chart in a source report and pass it to a target report so that it is consumed by a crosstab in that 2nd (target) report?
So, for example, my Source report has a measure called [High Risk %]. I want to pass the first word 'High' to a target report so that it filters the Risk Level dimension to only show [High] risk level data. The Risk Level dimension only has 3 values (High, Medium and Low).
This seems like it shouldn't be that big of a deal but I can't figure it out. How to do this in a prompt macro?
Create a calculated data item in the parent query which does this. Include it in the chart query, and pass that instead.
Related
I'm working on a table report where the client needs all lines fulfilled with data, with no blank spaces.
We need the Date information, for example, to be repeated for each metric line. And so the Number, Week Day, and Store.
This can be made?
The grouping of attribute values happens automatically and it is there to make reports easy to read. There is not a functionality to repeat attributes values in reports. So, it cannot be made in the report.
Attribute values are repeated, if report is exported to CSV file.
You can try to redesign the report to avoid the grouping.
I am trying to write a calculated member which acts differently depending on whether the user is filtering by that member or has it dragged down as rows or columns on their pivot table (using Excel).
The rules are:
1. If the user is using the date dimensin as a Report Filter in Excel, then the calculated member should get the maximum date out of all dates that they are filtered by.
2. If they have the date dimension as rows on the pivot table, then I need to apply ClosingPeriod and some other logic.
Please try this. The idea came from here.
Basically the dynamic named set represents what's in the report filters. And the EXISTING keyword trims the list of days down to the filter context of the current cell letting you detect say if one month is on rows. Compare counts and you can detect what the user did.
CREATE HIDDEN DYNAMIC SET CURRENTCUBE.SelectedDays as
[Date].[Date].[Date].Members;
CREATE MEMBER CURRENTCUBE.[Measures].[My Calc] as
CASE
WHEN SelectedDays.Count > {existing [Date].[Date].[Date].Members}.Count
THEN Tail({existing [Date].[Date].[Date].Members},1).Item(0).Item(0).Name
WHEN SelectedDays.Count < [Date].[Date].[Date].Members.Count
THEN Tail(SelectedDays,1).Item(0).Item(0).Name
END
Performance is going to not be good. And I suspect users will be confused with the results of your calc. If you want to describe the business scenario more I can maybe recommend a better approach.
I have a very large dimension in my OLAP cube - a customer dimension. Each customer has her own unique ID. I require a pivot table to be filtered for a single specific customer (ID).
Unfortunately Excel Pivot table takes very long to display the appropriate customer ID (checkbox) in the report filter.
It also does not help to pre-select customer from a specific town or birth year - it seems that all customers are scanned anyway.
How can I speed up this process?
Is there maybe a specific setting/property that I can apply in the SSAS solution?
Would attribute relationships help?
Can I maybe pre-calculate something in the cube?
Maybe I should add an additional attribute to the dimension?
Try Olap Pivot Table extensions for Excel. You can insert a filter list without having to wait for the costly excel filter.
You could add an attribute hierarchy to the customer dimension ItIsJoeBloggs. In the customer dimension table this would be True for the JoeBloggs rows and False for all others.
Then in Excel this hierarchy could be an additional filter with True selected.
I have a crosstab report that calculates for failure rates for my products ; it has two measures (PASSCOUNT, FAILCOUNT) and a calculation FAILRATE (FAILCOUNT/PASSCOUNT+FAILCOUNT)
The report layout looks thusly:
OEM
MODEL
TESTYEAR TESTMONTH PASSCOUNT FAILCOUNT FAILRATE
When I select the Total icon, it logically adds up each of the columns like so
2012 OCT 7547 697 0.08
NOV 9570 373 0.04
DEC 1879 107 0.05
------------------------
Total 18996 1177 0.17
My user however wants TOTAL FAILRATE to be
TOTAL FAILCOUNT/(TOTAL PASSCOUNT+TOTAL FAILCOUNT)
which translates to
1177 / (18996+1177) = 0.058
How can I create this custom total in the report? I am reading about creating a Query calculation but I am not clear this is the right approach.
Cognos Report Studio 8.4 IBM DB2 UDB
You can indeed. There a couple methods.
In your report query you have the individual query items that comprise your desired calculation working fine(PASSCOUNT, FAILCOUNT, etc...). You can create a new data item/expression in that same query item list and edit the definition. In the left hand side you can choose to use columns from your original db data source but there is another pane you can select to actually re-use other query items/calculations you have definied in that same query (PASSCOUNT FAILCOUNT FAILRATE). Cognos knows that when you create an expression using other columns in the same query to resolve those query items first in order to resolve your calculation that is dependent upon them. You want to make sure your calculated/derived column is listed after the other dependent query items(Actually this may not matter but it makes sense when looking at it). Also I believe you will have to set the the failure rate query item/expression to "Calculated" as its aggregate method.
The summary line might/might not be a bit trickier. Not having report studio right in front of me it might be smart enough when you add the totals section to the list report and use your new failure rate expression... to extend the correct calculation or you may have to use another method to do the summary which is a report expression.
You create a report expression not in the query but on the gui page of the report(its in the toolbox along side tables, singltons etc...). It has an expression builder just like in the query but you will notice the function set is different because it is being done after the query runs and as the results come back so simple things like you are doing is fine which is just math but you will notice other database functions are not available on report expressions simply because they are occuring in the html output and not during the query run against the database.
Hope this helps. In summary you are creating a calculated column based on the summarized calculations of other columns in the same query/result set. This would be in theory the same as this SQL statement which will not work because SQL does not allow this directly but hope it helps explain what cognos is doing.
Select 1+2 As FAILCOUNT, 2+3 AS PASSCOUNT, (FAILCOUNT/PASSCOUNT+FAILCOUNT) AS FAILRATE From SOMETABLE
-- Cognos is able to use the results other aggregate calculated columns in the same query and if you gen sql you can see how it arranges the SQL to do this.
Thanks,
Tim
It's important to pick the right total in Crosstab.
When you add the total row, make sure you pick Automatic Summary:
This option will make sure the aggregation is determined individually by each query data item.
If it still does not give you expected result, then on the query explorer, pick the query that is being used on the crosstab, and on the FAILRATE data item, pick the calculated option (on the properties panel):
In the crosstab reports what happens is the columnar data is rendered first n then the row level data, so this is the cause of your problems ..To resolve this click on the List Column Title 'FAILRATE' & assign it a Solve Order = 1, as long as the solve order of total is NULL..The trick is that the Solve order would control the calcuation of FAILRATE after all others are done.
I am working on a PowerPivot report that has the following tables/relationships:
FactTable:
SponsorId
OfficeId
Type
Color
Quantity
DimSponsor:
SponsorId
SponsorName
ProjectName
DimOffice:
OfficeId
Region
Country
Manager
NumberEmployees
Relationships exist FactTable to each of the two dimension tables.
I wish to create a calculated measure that is the SUM(Quantity)/SUM(NumberEmployees) which represents the average number of items processed by number of employees.
I believe I am having the problem listed here at PowerPivotPro FAQ
When I create a pivot table that has an X-Axis of [Region] with [NumberEmployees] as the only value it always displays the sum of ALL [NumberEmployees] regardless of any slicer selection (in this case, I created a horizontal slicer of [SponsorName]).
I am new to DAX and have struggled to find a formula to meet my needs. Is there any solution to this problem?
I found working examples of what I needed to accomplish on Marc Russo's blob. It is a matter of creating a custom measure that filters the Office table by the already filtered rows of FactTable.
As some of the comments on the page mention, it isn't as easy as drag-n-drop but it works.