Getting calculated range values with Microsoft Graph and the Excel API - microsoft-graph-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.

Related

GOOGLEFINANCE Formulas in arrays for Google Sheets

I have a product with In-App Purchases in several markets in which transactions happen in their local currency. Created a Google Sheet for the purpose of reporting revenues in our base currency (USD). I tried several things to create the most effective method to automatically read the currency pair for each transaction, but the formula isn't working.
I am attempting to accomplish 3 things here:
Create an array that will automatically convert different currencies to USD by using the GOOGLEFINANCE formula (see "G1" on the embedded spreadsheet).
Eliminating error when conversion finds a value having the same ISO codes (see "F12" on the embedded spreadsheet).
Calculating the transaction using the exchange rate of the day of the transaction instead of TODAY's exchange rate (no clue on how to do this without breaking the GOOGLEFINANCE formula).
Here is the formula I am using on Col "G" is:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E*GOOGLEFINANCE("CURRENCY:"&D2:D))}
The problem with this approach is that it replicates the value of cell "D2" down the whole array, instead of consecutive values from D2,3,4, etc, accordingly. Removing the "&" from the array breaks the formula.
While the formula used on Col "F" =E2*GOOGLEFINANCE("CURRENCY:"&D2) works, the problem here is that it has to be placed manually, row by row, and this is inefficient when dealing with thousands of records. Also, you will notice on cel F12, I get an invalid value because GoogleFinance cannot convert from dollars to dollars. The formula outputs an error. Is there a way to make the formula understand that when trying to convert a value with the same currency ISO's, the value stays the same?
Even while I get the correct calculation on approach #2, the data calculated is based on TODAY's exchange rate, however, I need that calculation based on the exchange rate of the same date of the transaction. Is this even possible?
The referred spreadsheet example is here: Google Finances Conversion Formula
GOOGLEFINANCE is not supported under ARRAYFORMULA
if your D2:D range is small you can do:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E5*{
GOOGLEFINANCE("CURRENCY:"&D2);
GOOGLEFINANCE("CURRENCY:"&D3);
GOOGLEFINANCE("CURRENCY:"&D4);
GOOGLEFINANCE("CURRENCY:"&D5)})}

Google Data Studio Dates and Text

I am having trouble with two things trying to setup my report on Google Data Studio.
Using numbers with dates.
I have some numeric values to use with dates. However, I have the same date for different values and google sums up those values and I need them separated.
Also, when a certain day does not have any value, google gives it value 0 and I cant have that because the value isnt 0, I just need it to skip those days. I have generated a graph as an example.
I can´t generate a graph using text as a dimension. I think I am doing something wrong but I wasn´t able to.
Table:
Graph:
1) On the line chart, set the date as dimension, set the city as the breakdown dimension, the clicks as the metric.
2) create a chart filter and exclude when the "clicks are null"

Fixed Calculated Column in Reporting Service Header

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.

Google Spreadsheet: Summing up a range by using numeric value in another cell

I'm an AP Biology student and am trying to create a mathematical model for a Hardy-Weinberg lab using Google Spreadsheet. Here is the link to the spreadsheet. The problem is located on the "Gene Flow" tab on N111.
So I am trying to add all the number values above N until it hits a certain number. That quantity of organisms is dependent on the total number of organisms AFTER the migration of Generation 1. And that migration is just random chance of whether some will leave or arrive. By adding up the new generation, I need to calculate the genotypes of their offspring (a.k.a. Generation 2), assuming there is 1:1 ratio between each generation.
Here is the code I tried:
=SUM(N6:N(SUM(F107:H107)+6))
However, the error I receive is Argument must be an range.
Is there a way to properly express this through Google Spreadsheet?
You could use the INDIRECT function. It returns a cell/range reference with only a string as input. For example:
=SUM(INDIRECT("N6:N"&(SUM(F107:H107)+6)))

Excel 2010 dynamic named range is replaced with the calculated range

I am trying an experiment using a series of dynamic named ranges to generate a series of charts under Excel 2010 (Microsoft Office Professional Plus 2010).
The problem I am running into is that the name of the dynamic range gets replaced by that calculated range after the name is entered.
In this experiment I am using a simple line chart to show the data.
I am selecting the Select Data... pop-up menu option for the chart.
In the Select Data Source dialog box, I enter the named data range into the Chart data range TextBox, and hit enter.
I enter ChartNumbers and it gets replaced with =Drawings!$E$316:$E$465
I have ChartNumbers defined as =OFFSET(Drawings!$E$11,Drawings!$X$4,0,Drawings!$W$4,1)
After setting the chart's data range, any changes I make to the size of the data table are not reflected in the chart. I have to reapply the named data range to get the chart to show the new data set.
All the examples I have seen, mention nothing about Excel replacing the named data range with the calculated range.
Is there a different method I have to use for charting a named dynamic data range?
Is there a checkbox somewhere to prevent this from occurring?
There are 2 issues you may be running into when using named data range:
You MUST do this to the chart series not the chart data range as Excel will translate the Offset named range to an actual range that will not remain dynamic.
When adding the named range to the chart series, you MUST reference both the file name as well as the named range (i.e. FileName!NamedRange).
Here is a detailed posting and video to help you out.
case-study-creating-a-dynamic-chart-in-excel-using-offset-formula
Let me know if it helps.

Resources