How to keep the Cognos List structure? - cognos

I have this list with some Grouped columns and with some non grouped columns as well as some List Header and Footer.
I also have some automatic created TOTALS for some of the metrics as well as some manually created totals for some metrics.
QUESTION : I now simply need to REPLACE a metric on the report by another metric. Problem is that the list displays automatic totals for some of the metrics including the one i need to replace so i want to know if it will break (destroy) the structure of my list and will i need to recreate its structure or is there a way to replace the metric without affecting my list sttucture, therefore no need to recreate my totals
Regards !

I believe you can go to the query for the list
In the query, find the data item
Change the expression definition to the new thing you want
Change the property for the name & label too
This way you do not have to adjust the layout

Related

SSRS Cells auto-merge

I'm having trouble unmerging cells on the report.
3 Suppliers for the query
I have a SQL query that shows 3 instances of a supplier (left joined to contact) as shown below. However, when running the report for the query the 3 instance of the supplier is merged into one. This is not desirable in my case because when exporting the report to excel, I'd like to be able to sort columns based on other properties, however, this would not be possible due the the merging of the rows. How can I get results to show individually?
Cells are Merged on the report
Within the properties of each Row Group you can specify which columns to group on. You generally don't need a separate group for each field, but that's OK. In your last group, the one called "(Details)", if it is not grouped by anything, it will show one row per line of results from the query. So take a look at what it's grouped by. As long as the rows are in your dataset, the report will group or show them based on how you configure the grouping here. Grouping on nothing means it will show all rows.
Another tip is to align the end of your header textbox with the line of one of your columns. This will prevent it from creating an extra column in Excel for the "City" field.
Your report does not need all of those groupings - the SSRS grouping is not like SQL. You should only group when you want to aggregate data on that field. Normally you might have a company with its address in various fields in one group but you only need to group once on the Company Name or (preferably) ID - not on each field and not a separate group for each. You could then show details of various invoices in other columns that aren't grouped.
But since you want to display the company data on each row, you would not want ANY grouping on the company.
To fix your issues, remove all the groupings (but not the rows) and just leave the detail group (which doesn't have a Grouping).
You can check out MS Docs: Understanding Groups for a better explanation.

Incorrect data being pulled from a SharePoint list to Power BI

When I pull data from a SharePoint list into Power BI, the values are pulled incorrectly for columns having the data type -
Person or Group - instead of names, numerical values are pulled. I guess these are the IDs of the values
Lookup - instead of the actual values, '[list]' is pulled in a nested column. When I expand, numerical values are shown. Again, seems like IDs
All other data types are pulled properly.
To work around this problem, I first pull the data from the list to Excel and then to PBI. However, I want to eliminate this manual step as the list will have frequent updates and I will need to pull the list data into Power BI regularly.
What should be done to pull the actual values as they appear in the list?
For the lookup columns: You need to pull in the lists where the lookup values are being looked up from and then create a relationship based on ID.
For the People: Look here:fully explained how to deal with Person object
I did some looking around and was able to find a solution.
Using the FieldValuesAsText column in the Query Editor, I got the values in the table. values for both column types were available. Since, I only needed the text values it solved the purpose.

SSAS Calculated member that knows if the user is using the report filter

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.

How do I create report-like data tables in Excel?

In the past I have created websites that extract data from a database and format it using tables.
Now, I am trying to do the same thing but with Excel, and I'm lost. I am used to using SQL commands to extract data from given fields and then sort/manipulate it.
Currently, I am able to print a report that provides me with an Excel spreadsheet full of raw data, but I would like to make my life easier and organize it into a report.
The column that I would like to reference contains duplicates, but the data in the adjacent columns is different.
To give an example, assume I had a spreadsheet of sales transactions. One column would be the Customer ID, and the adjacent columns would contain the quantity, the cost per unit, total cost, order ID, etc.
What I would want to do in this case would be to select all the transactions with the same Customer ID and add them together based on their Order ID. Then, I would want to print the result to a second sheet.
I realize that I can use built-in functions to accomplish this, but I would also like to format this report evenually using VBA. Also, since I will have a variable number of rows that differ from one report to the next, I haven't encountered a fucnction that will allow you to add rows.
I'm assuming this must be done with VBA.
Well you can do it manually, but it would take ages. So VBA would be good, particularly as you would be able to generate future reports quickly.
My interpretation of what your saying is that each row in your report will be the total for one customer ID. If it's something else, I imagine the below will still be mostly relevant.
I think it would be a bit much to give you the full answer, particularly as you haven't provided full detail but to take a stab at what you'd do:
Create your empty report page, whether it be a new worksheet or a new workbook
Loop through the table (probably using While next is not empty)
a. Identifying if a row is for a customer ID you haven't covered yet
i. If so then add a new entry in your report
ii. Else add it to the existing customer ID record (loop through until you find it)
Format your report so it looks pretty, e.g:
a. Fill the background in white
b. Throw in some filled bars
c. Put in good titles and totals etc.
For part 1, it might be better building an array first and then dumping the contents into the report. It depends how process intensive it will be - if very intense, an array should shave off time.

Can I create a COUNTIF calculated column in SharePoint?

Is there a way to create a SharePoint calculated column that returns a count of the number of entries in a list? So If I have 3 customers in my list with the company "Starbucks" I'd like the field to return "3"
(Edited some wording for clarity per suggestion from dariom).
You may be able to get what you want with another list using a not-so-well-known variation of a lookup column.
Let's say you have a list called Companies with values in the title column like "Starbucks", "Peets", etc. Now you also have the Customers list you refer to, but the "Company" column is a lookup column pointing to the title column in the Companies list.
You can add a count very similar to what you described to your Companies list. Go to your Companies list, add a column of type "Lookup" referring to the Customers list and you'll notice that in the drop-down area where you define the lookup if you point back to the Customers list, you'll have a new option called "Count Related". This is here automatically because it recognizes that the Customers list has a lookup pointing back to this one. Select that Count Related option and now your Companies list will have a column counting how many customers are associated with that company.
No coding, Javascript hacks, or anything. Just hidden SharePoint auto-magic.
No, I don't think there's a way to do this using the out-of-the-box calculated column.
Some other ways you could accomplish this are:
Create a view for your list that with a group by on the company field and include the total count. This is easiest, but might not be exactly what you're looking for.
Create a custom column type that executes a CAML query to find items that you're interested in. There is a learning curve if you've not done it before and if the list that you're adding this custom column to has lots of rows, you'll be executing a query for each row which is inefficient - it'll be OK for a small number of rows.
Use an event handler on the list that updates a column value each time a new item is added or removed from a list. This is easier, but can also be inefficient if you have a large number of items in your list.
As dariom said (damn my slow typing skills, +1!), only the current row can be operated on with calculated columns by default in SharePoint. There are a couple of documented workarounds involving SharePoint Designer or jQuery, though.
You can get a Count of specific list items in an XSLT Data View
To do this you will need SharePoint Designer.
Right click on your SharePoint List view (ensure the list view contains the field you want to filter by) select convert to XSLT Data View. Then in the Data Source Windows select Data Source Tab and drag and drop the field you want to get a total on for the specific items into where you want it displayed in your XSLT Data View. Click on the numerical value that is showing you should get a lightening bolt icon, select the drop down and choose Count, then select again and choose Filter. Select "Click here to add a new clause" then choose your field name again and enter your unique value as Starbucks and click OK, you can repeat this process for other fields you want the totals on. You will now see the total number of Starbucks items in the list.
I got something similar to work in a way similar to Niall. Basically, I:
Based on the source list, created a Data View Web Part (DVWP) on a "test" web
part page.
Added the footer column, which gives a count.
Set the filter for my conditions (i.e., the items I want to count).
In the code, deleted the recurring items row.
I was left with just the footer, which displayed a filtered count for all the list items. I further customized the footer by taking out the shaded background. Finally, I exported this web part and imported it onto the page where I wanted users to see a total of items in the list (which met the criteria).

Resources