Missing values in Cognos Report prompt - cognos

I have a problem with missing values in a Cognos Report Studio value prompt.
I have two queries
Query 1 contains business unit and sales (measure)
Query 2 contains only business unit (no measures)
Query 1 shows all the possible business units and their sales, while query 2 for some reason shows only half of the business units.
On the prompt page, I have a value prompt where I want to display all the business units. However, I get the same result (only the business units from query 2) even if I use query 1 as source for the prompt.
Any ideas?

Related

Resolve "missing relationships" message

I get the "relationships between tables may be needed" message in Excel 2016 PowerPivot. I suspect this is because I've got a many-to-many relationship, but lack experience to be sure. I'll be happy to read up on it if someone can help me put a name on the problem.
The data that I'm analyzing looks like this:
Units - Instances of a product. E.g. the computer was produced 100 times = 100 units. Each unit has ONE ProductID, and a UnitID (unique). Units have e.g. a production time.
Products - Each product can consist of several items. A product could be computer xyz = "laptop xyz, driver CD, manual, power brick, 2 chocolates and mains cable". Each product has a unique ProductID and an PackListID. Several products can have the same PackListID.
PackList - Unique PackListIDs
CompositeList - for each PackListID, this can contain several ItemIDs and number included in packing list (e.g. 2 pieces of chocolate)
Items - line items for a product packing list, e.g. "manual for computer xyz"
I want to answer the question: How many (compositelist.number) line items of each Items have been included in units produced on a particular date (units.date).
I read the data by SQL from a existing application/database server. I cannot influence how the data is structured :(
I've imported my data and connected as follows:
Unit.ProductID -> Product.ProductID (each product can have many units)
Product.PackListID -> PackList.PackListID (bridge table)
PackList.PackListID -> CompositeList.PackListID (each packlist can have many composite-rows)
CompositeList.ItemID -> Items.ItemID (each composite-list refers to one item)
If I filter by PackListID, the result is a correct list of line items with sums.
Now I'd like to multiply that with the number of times that packlist has been produced on a particular day...
My pivot looks like this:
Filter: Production date, filter to a particular date
Rows: Items.text
Values: Sum of compositelist.number
I would love to see the number of line items used in production on a certain day, e.g. 15 manuals and 32 mains cables.
Unfortunately I get the message "Relationships between tables may be needed".

create an excel report based off 2 list

im facing this issue whereby i have 2 seperate list reports 1 of them contains details of warehousing inwards quantity, while the other contains details of warehousing outwards quantity. These lists contains basic details like item models, date and quantity.
now the problem've is I would like to create a 3rd list, that concludes each end of day warehouse movement. What is the best way to create this 3rd list given that i'm able to utilize accessDB for ease of data management as well ?

Pass multiple account variables to single parameter

I am building a financial report. Months as columns, department/account as rows, summing transactions:
I am able to expand departments and see totals by account, I am also able to click on a single account amount and drill through to another report for transactional detail. Say account 70300 for March totaling 14,244. This work wells. The report successfully passes Department 000, account 70300, 201503 for March 2015, showing me the transactional detail for the account.
My issue is being able to drill through for a department, say the 1,063,038 for department 000 for March. I am able to click on the value and pass it actually passes all the accounts with data for the month to the filter Acct, however it returns no data:
I thought it would have something to do with how the separator is stringing the accounts together in my expression. I have tried “,” and “, “. Looking at other reports I have created with multiple criteria selection from a drop down list it always displays selections separated with a comma then a space but that is not working for me. Here is the expression I am using via Text Box Properites -> Action -> Expression:
=IIF(Inscope("matrix1_G_L_Account_No_"),Fields!G_L_Account_No_.Value,Join(LookupSet(Fields!Global_Dimension_2_Code.Value, Fields!Global_Dimension_2_Code.Value, Fields!G_L_Account_No_.Value, "DataSet1"),","))
Any advice is greatly appreciated!

Performance tuning in Cognos Report Studio

Working in Cognos Report Studio 10.2.1. I have two query items. First query item is the base table which results in some million records. Second query item is coming from a different table. I need to LEFT OUTER JOIN the first query item with other. In the third query item post the join, I am filtering on a date column which is in formatYYYYMM to give me records falling under 201406 i.e the current Month and Year. This is the common column in both the table apart from AcctNo which is used to join both the tables. The problem is, when I try to view Tabular datathe report takes forever to run. After waiting patiently for 30 mins, I just have to cancel the report. When I add the same filter criteria to the 1st query item on the date column and then view the third query item, it gives me the output. But in the long run, I have to join multiple tables with this base table and in one of the table the filter criteria needs to give output for two months. I am converting a SAS code to Cognos, In SAS code, there is no filter on the base table and even then the join query takes few seconds to run.
My question is: Is there any way to improve the performance of the query so that it runs and more importantly runs in less time? Pl note: Modelling my query in FM is not an option in this case.
I was able to get this resolved myself after many trial and errors.
What I did is created a copy of 1st Query item, and filtered 1st query item with current month and year and the for the copy of 1st query item added a filter for two months. That way I was able to run my query and get the desired results.
Though this is a rare case scenario, hope it helps someone else.

How to use Cognos report studio to change default Total() calculation

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.

Resources