Fixed Calculated Column in Reporting Service Header - asp.net-mvc

I'm using Reporting Service in .net core
I want to display the total cost in the Report header, it calculated by the sum function
and it only get the right result be display in the table that view data
How to calculate this column and display the Result in Fixed header ??

You can use this expression:
=Sum(Fields!TotalCost.Value, "YourDataSetName")
This expression can also be used in a single textbox, which you put into your report.
And btw your TotalCost column has to be from type numeric. If this is the error source use a
CDbl(Fields!TotalCost.Value)
before the function.

Related

How do add a Percentage column to this Google Sheet pivot table

I have a pivot table, in Google Sheets, and want to add a percentage column.
EDIT: here is a link to a sample spreadsheet: https://docs.google.com/spreadsheets/d/12qyhOtKphW1iBWAOtfDHU1RdZRZ_Nq91eQtdghZzIyc/edit?usp=sharing
Below you can see the pivot table with the column (E) that I've manually added next to it, showing what I want to achieve, but as part of the pivot table, which is a simple:
E4=D4/C4
However, I have tried adding a Calculated Field under Values but can't work out the right formula; this didn't work:
='Checked In'/'Events'
nor did:
=D4/C4
I'm sure it's something simple, but I can't for the life of me work it out. Can anyone shine a light on what I'm doing wrong please?
Short Answer: Only use the column headers of the raw data and not the column headers of the other existing calculated fields.
Note: Since you have not shared a sample spreadsheet, I have made a sample data just to show the process.
Sample Raw Data
Creating a Pivot Table
Select the desired data to be added to the table which only includes the useful column headers (like the one selected in the sample raw data image).
Add a Calculated Field
To add a calculated field, look for the Values section in the Pivot table editor and click add (as shown above). To enter a formula, the pivot table editor requires you to use the column headers instead of the cell range (A1 notation). The formula you provided works just fine. In this case, I used ='Checked in'/Events to check if column headers with one word do not necessarily need single quotation marks (which will result in the following):
Note: Always use 'string' (single quotation mark) format in using column headers especially when the column headers contain spaces (like Checked in in the example).
Note: You may change the Column Header Output just by selecting the cell and renaming it.
Sample Modifications
You may also use other Google Sheets functions in the formula just like:
Which results to:
Reference
Create & Use Pivot Tables
Additional Info
When trying to add additional calculated fields using data based from other calculated fields, always use the original column headers of the raw data and not the column headers of the calculated fields as it returns an error just like the one below:
In your case, I modified your formula to
=COUNTA('Venue Name')/COUNTUNIQUE('Event Date')
Since both Venue Name and Event Date are the column headers of your raw data and not Checked in and Events. The current output of the corrected formula should look like this:
To address the decimals in the output values, you may refer to the Sample Modifications section of this answer.

QUERY function not including text cells along with number cells in result

I'm currently trying to copy a list using the QUERY function in google-sheets.
The problem im now facing is that words / letters are not included in the search.
Example picture
Im using the function: "=QUERY(E2:F5;)" but don't get the words included.
Is there any way to include these words by using the formula above as guide?
In google-sheets, use Format, Number, Plain Text on your source range of E2:F5 and your original formula will work.
=QUERY(E2:F5)
From Docs Editor Help - QUERY function
In case of mixed data types in a single column, the majority data type determines the data type of the column for query purposes. Minority data types are considered null values.

Getting calculated range values with Microsoft Graph and the Excel API

With the graph explorer & excel API I was able to get the used range of a worksheet with following endpoint:
https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedRange
However, the request returns a json full of formulas instead of the values calculated from those formulas that appear in the cell when opening the workbook in excel.
Is there a way to get Microsoft Graph to calculate my workbook instead of returning formulas when fetching ranges or cells?
You could use values or text property of range object to get to computed values. text is what the users would see after applying number format (non trimmed version).
If your workbook is in manual mode and you like to calculate after updating the formula, you could run the calculate API against the workbook.
POST /me/drive/items/{id}/workbook/application/calculate
Body is optional. If you wish you could use below calculation options.
{
"calculationType" : "{calculationType}"
}
{calculationType} specifies the calculation type to use. Possible values are: Recalculate Default-option. Performs normal calculation by calculating all the formulas in the workbook,Full Forces a full calculation of the data, FullRebuild Forces a full calculation of the data and rebuilds the dependencies.

Get Range of Cells Value as Display using Microsoft.Office.Interop.Excel

I am programming with C# to access data from a range of cells in Excel Spreadsheet.
I can use the following code to access and return the values of range of cells into an object array.
(object[,])Mysheet.UsedRange.get_Value(XlRangeValueDataType.xlRangeValueDefault);
However, I like to find a mean to return all data as strings (exactly as shown on the spreadsheet) into a string array or putting the values as text into the object array. Are there any mechanism to do that>
Did you try using .Text in the Range object? As far as I know, you will have to iterate over each cell and do it for each of them.
Note that .Text is considerably heavy in terms of performance compared to Value or Value2.
And also note that it is also tricky, .Text returns the text as you would see it if you had Excel visible, so if you have a huge number in a column with a short width what .Text will give you is a lot of ####
Sadly I can't think of another way to get it. Usually I get the raw values and format them properly once a get them all, but that assumes that I know which format is used in which cells.

Summing values in repeated sections in Orbeon

I have a problem when it comes to suming values from a repeated section. Specifically, when I have a repeated section in the orbeon builder with a control that has a value I can easily sum the values of these sections in a different control using sum($control-1) - in the calculated value. When inputing values in the form preview the sum is correct in my control with the summed value.
Unfortunately, when I add a section using the +Insert Below button in the form preview while testing the form the sum() function doesn't work anymore. In the control with this calculated value nothing is shown. Is there a different way to get the sum of values from repeated sections or is this a bug in orbeon?
Once you add a new section while testing the form the sum() function doesn't work anymore, because it adds a empty element to the node-set.
In XPath, when using the sum function, the value of each node is determined by trying to converting it to a number (number()), if there is a empty value, it's gonna convert to NaN, thus in the control with this calculated value nothing is shown by Orbeon.
A different way that would work would be to use the expression like: sum($control-1[text()]) . This way you are testing if the node has content before trying to sum it, so it's always gonna work.

Resources