COGNOS REPORT STUDIO grouping - business-intelligence

I am new to cognos.
I have created a list report with the following columns...
ID,Forename,Surname,ProductCode,ProductTitle
I have two value prompts (drop down boxes) for the user to pick two product titles.
I want my list report to only display when a Customer has purchased both products. At the moment I have all Product1 all Product2 and all where Product1 and Product2 are relating to one customer.
I have then grouped by ID,Forename,Surname.
I have tried doing counts and running-counts but can't seem to come up with a solution.
Any advise would be much appreciated.

Filters:
[ProductCode] = ?product1? || [ProductCode] = ?product2?
count(distinct [ProductCode] for [ID]) = 2
The first filter limits the rows to just ones where the product matches either prompt. The second counts up the distinct product codes for each customer and excludes customers that don't have two.

Related

DAX Measure displaying values only for certain combination

setting up a SSDT in Visual Studio where I have masterlist with prices and 3 addtional attributes. These 3 attributes (Region, Customer, Material) can be used to to link the data to the other table with all the sales information etc.
Target: Showing the prices in a pivot if the 3 attributes are fulfilled and are matching to the other table with the same attribute combination. Assuming a calculated column is not solving the problem as this cannot display the price values in the value section of the pivot.
enter image description here
Please help me to find an appropriate DAX measure to link the data and show the prices for the matching attribute combination.
Thanks in advance :)
Masterlist with attributes which can be used as a key to connect to the other list?

OBIEE Merge two queries (join)

I need help.
I am new to obiee (recently moved from business objects and re-creating all reports in obiee).
Here is an example I need help with. I have created an analysis where I am listing all orders with their target delivery dates and number of products in each order.
Order Id......Target Delivery Date...No of products
Abc....1/1/2016.....5
I want to add to a column next to No of products called "No of prods delivered on time". I want to compare delivery date of each product within a order with the target delivery date and
Give count of products delivered within the target date.. So the output should be
Abc....1/1/2016....5.....3
Where 3 is number of products delivered on time.
I could do it in BO by running two queries and merging them however in obiee I am not able to add second query to my analysis. I did try at product level using case when target date >=delivery date then 1 else 0 and wrapped this with sum function to aggregate but it didn't work ..
Appreciate your help in this. Searching for this topics give me results for running queries from multiple subject area :(
You also have unions in OBIEE, you union the results of 2 queries which return the same structure, so you have query A with Order ID, Target Date, No Products and a Dummy column with a 0 and default agregation Sum, and a second query with Order ID, Target Date, Dummy column summing 0 and the number of products delivered.
You do all this in the criteria tab of the analysis. It's important the order in which you put your columns, because that's what OBIEE is using to do the union.
Regards

Google Sheets For Filtered Drop Down

I have two sheets: CONTACTS and UPDATES.
On the CONTACTS sheet there are 2 columns: COMPANY and NAME. If I have 10 contacts at a company, then there will be 10 rows with the same company in column 1, and the names of the 10 people in column 2. Now of course there's a lot of companies and names on this list.
On the UPDATES page, column 1 is a drop down that lets me select the name of the company. In column 2 I want to have a pull down that filters and shows me only the people in the company that's in column 1.
I've searched quite a bit and while I have found things that are similar, none of the tips are quite right / work for my use case.
Is there an easy way to do this?
Thanks for your help!
You can use UNIQUE + FILTER to filter the results, but that won't give you the a dropdown. For a filtered dropdown, you can use the formula to get the filtered list and then use that as your range.
For example, in your CONTACTS tab, add a new column FilteredList, with this formula in the first row:
=unique(filter(B:B,A:A=E1))
where B:B is the NAME column, A:A is the COMPANY column and E1 is where you select the company name on the UPDATES page.
Now, instead of making the NAMES list as your valid entries, set it to FilteredList.

Ms Access 2007 - Can sort or group report but not both, can't figure out why

I'm stuck and confused and hopefully can get some help here. I have a query that pulls info from two tables and a report that reads it. My two tables are as such: One of the is a Contact list with phone numbers, names, and addresses. The other table is a paid history. The PhoneNumber field is how they're tied together. There are no duplicate entries in the Contact table but there are multiple paid instances per phone number in the other table.
My report groups them on the phone number, but I also need it to sort by date. My date field is marked as time/date, and it is in the paid table. The issue I'm running into is that I can either Group on PhoneNumber OR sort on the Date field but not both. When I set the Group as the top level, it ignores the Sort that I have set below it. If I take the sort and drag it up so that it becomes the top level, it won't group. When it doesn't group I'm left with multiple instances of the same Contact info... as in I get a new listing for every date that it has ever paid, whereas I need one a single Contact listing with each paid instance to be grouped underneath it.
Here's my query SQL:
SELECT
tblContributorsLead.FirstName,
tblContributorsLead.LastName,
tblContributorsLead.Address1,
tblContributorsLead.ZipCode,
tblContributorsLead.CityName,
tblPledgesLead.PledgeAmountRecd,
tblPledgesLead.DateRecd,
tblPledgesLead.PhoneNumber,
tblPledgesLead.DispositionTime,
tblPledgesLead.Agent,
tblPledgesLead.CampaignName,
tblPledgesLead.Custom20
FROM
tblContributorsLead
INNER JOIN
tblPledgesLead
ON tblContributorsLead.PhoneNumber = tblPledgesLead.PhoneNumber
WHERE
(((tblPledgesLead.PledgeAmountRecd)>0)
AND ((tblPledgesLead.DateRecd) Is Not Null));
Why would I only be able to either group OR sort but not both at the same time?
Edit: http://icloudbackups.com/stripped.zip is a copy of my database stripped down.
I think I understand now what you wanted - to have the phone number groups with the most recent dates show up at the top. To do this you need to identify the Last (or First if you need it the other way around) DateRecd for each PhoneNumber.
SELECT SortingAndGrouping.LastDate, SortingAndGrouping.PhoneNumber, tblPledgesLead.DateRecd
FROM (tblContributorsLead INNER JOIN tblPledgesLead ON
tblContributorsLead.PhoneNumber = tblPledgesLead.PhoneNumber) INNER JOIN
(SELECT CDate(Format(tblPledgesLead.DateRecd,"MM/DD/YYYY")) As LastDate, tblPledgesLead.PhoneNumber
FROM tblContributorsLead INNER JOIN tblPledgesLead ON
tblContributorsLead.PhoneNumber = tblPledgesLead.PhoneNumber
ORDER BY tblPledgesLead.DateRecd DESC) AS SortingAndGrouping ON
tblContributorsLead.PhoneNumber = SortingAndGrouping.PhoneNumber
ORDER BY SortingAndGrouping.LastDate DESC , SortingAndGrouping.PhoneNumber, tblPledgesLead.DateRecd DESC;
You will need to add the additional fields you want to display (I removed them here for clarity), and have the report enforce the same sorting I have here - Create a group for the LastDate column, then a group for the PhoneNumber column, then have the sorting specified.

Sort Report table by totals

I have built a report with a table. It looks very much like the table in the following link (last figure, before "Next Steps").
Microsoft Tutorial: Adding grouping and totals
I have turnover values for products which are grouped by subcategories and categories and have a total for subcategories and categories. I want to sort the table by turnover (in the example it is "line total"). I can do that for the single product values in a subcategory, but not for the totals. Is that possible?
For all people interested: the row groups can be sorted by themselves (in Row Group - Group Properties). As the sort expression, one has just to choose SUM(Fields.LineTotal.Value).

Resources