Netsuite analytics workbook custom formula field not loading - analytics

I have created a custom formula field in a Dataset that has output type as Float. This formula shows correct output in the dataset. But when I put that formula field in a pivot table in a workbook as sum, it shows following error: "Cannot display data. At least one of the custom formula fields combines a function and values that are not compatible. Review the formulas and try again."
I have used this particular script to make the formula field:
CASE WHEN INSTR(TO_CHAR({custbody_pct_oss_config_len_notes#display}),'')>0 THEN
TO_NUMBER(SUBSTR(TO_CHAR({custbody_pct_oss_config_len_notes#display}),0,INSTR(TO_CHAR({custbody_pct_oss_config_len_notes#display}),'#')-1))+5
ELSE
TO_NUMBER(SUBSTR(TO_CHAR({custbody_pct_oss_config_len_notes#display}),0,INSTR(TO_CHAR({custbody_pct_oss_config_len_notes#display}),'#')-1))
END
This script allows only float as output type. So thats what I am stuck with.
Any help will be appreciated!

Related

Google Sheets: Using Transpose on an array in other tabs & identifying the tab by

I would appreciate some help, please.
I have a google sheet with many tabs with data going horizontally.
I would like to create a formula that imports and transposes the data into a vertical list.
However, I want to be able to type in (or drop-down list) to select the tab which the transpose formula to look at. I cannot get anything to work. I have tried this
=TRANSPOSE(A1&!B2:J2)
To add to that if it could use a lookup (vlookup or hlookup) to find the correct row to transpose then that would be great also.
I have set up a test sheet below. Please help. Many Thanks Tim https://docs.google.com/spreadsheets/d/1Menn6Z1mLl8wYOrcdQFnfs7Lp0dbC9UJe1S3AQRcOS0/edit#gid=0
You should not use IMPORTRANGE to work with data that exists anywhere in the same spreadsheet. IMPORTRANGE is for use retrieving data from a separate spreadsheet.
Instead, delete your current Sheet1!A2 formula and replace it with this:
=ArrayFormula(TRANSPOSE(INDIRECT(A1&"!B16:J16")))
I also added a new sheet ("Erik Help") with an advanced formula that accomplishes your lookup using whatever is types in B1. If whatever is typed in B1 exists in Column A of the selected sheet, the results of that row will be retrieved. If no match is found, IFERROR will return "No Match Found."
That formula, in 'Erik Help'!A2:
=ArrayFormula(IFERROR(QUERY(TRANSPOSE(INDIRECT(A1&"!B"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE)&":"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE))),"Select * WHERE Col1 Is Not Null"),"No Match Found"))

How do I get value of an indirect formula into a format that can go into an array?

My Google Sheet that will be updated over time with new sheets. On my dashboard/master sheet, I can write a simple INDIRECT that will pull information from a cell in the sheets. However, the formula does not replicate its way down the column. I understand that I need to use an ARRAYFORMULA to get the auto formula placement done.
I've tried many ways but the one that I think may get me there is to use CONCAT. My columns look like this:
Event Title [uses a script to pull in the names of all the sheets]
Use an array to get the titles so they pre-poluate down the column so I can use it later: =ARRAYFORMULA(IF(Row(A:A)=1,"Get Title from A",IF(ISBLANK(A:A),"",A:A)))
-- The Event Title is now appearing as plain text in Column B.
I then use CONCAT to write the part of the formula I need to help get the name of the INDIRECT in without using the INDIRECT formula.
=CONCAT("'"&B5&"'"&CHAR(38)&"!"&"""","B2"&"""")
-- This gets me this result: 'Computers 101'&"B2"
At this point, my hope is that I could then use this information ('Computers 101'&"B2") into an ARRAYFORMULA. I used this formula to try and do that:
={"Event Date";ARRAYFORMULA(A6:A+D6:D&"Cat")}
-- I get the answer: 0
The expected value was the date cell (B2) in the Computers 101 sheet. Any ideas how to proceed? I don't know the names of the sheets in advance.
unfortunately, this is not possible within of scope of google sheets formula. if you need ranges from other than the actual sheet you need to use INDIRECT which is not supported under ARRAYFORMULA.
you have 3 options:
hardcode it like: https://stackoverflow.com/a/68446758/5632629 with IFERROR & array of empty cells to match columns of your range
generate formula which will generate your final formula/range as a text string and then use a simple script to convert that string into the valid formula: https://stackoverflow.com/a/61819704/5632629
do it all with scripts

Using Excel Functions to Get Data into a Single Cell

I'm working with the Bloomberg Add-in on Excel to gather some data. The problem I'm having is to get all the data into a single cell. For instance, I want to get the daily change % for the past 5 fives for IBM. The formula I am using is:
=BDH("IBM US Equity","CHG_PCT_1D","11/9/2012","","Array","TRUE")
I made this using the Formula Builder, so I'm not sure why this isn't working. It returns error message: "#N/A Invalid Parameter: Invalid Override Field ID Specified"
If I exclude the whole array part, then it returns the data I want but in 1827 or so different cells. Any way I can get all of these in one cell?
Thanks
Use the working method that fills cells A1 through A1827.Then in cell B1 enter:
=TEXTJOIN("",TRUE,A1:A1827)
This cell will contain all the data you require.

Format numbers in data field of SSRS Matrix with two different number types using an expression

So, I have an SSRS report with a matrix. The columns, rows and data field are fed by expressions that refer to parameters. Effectively giving the report a pivot table style effect.
The data field has two values in the #prmDataField parameter to pick from when running the report. One is called LengthOfStayand in the databse is all integers. The second is called FinalCostand in the real world would be currency (GBP in this case) but of course in the database it's just a float.
There's a 4th parameter to apply an aggregate function to the data in the data field that's as follows;
=SWITCH
(
Parameters!prmFunction.Value="Avg",AVG(Fields(Parameters!prmDataField.Value).Value)
,Parameters!prmFunction.Value="Sum",SUM(Fields(Parameters!prmDataField.Value).Value)
,Parameters!prmFunction.Value="Max",MAX(Fields(Parameters!prmDataField.Value).Value)
,Parameters!prmFunction.Value="Min",MIN(Fields(Parameters!prmDataField.Value).Value)
)
My problem: I'm hoping there's a way to enter an expression into the Number format property of the data field textbox of the matrix so the data on the report will format depending on which of the datafield parameter values have been selected to run the report with. So if you pick LengthOfStaythe report will display the numbers as appropriately formatted integers. If you pick FinalCostthe report will display the numbers as currency instead.
I attempted this;
=SWITCH
(Parameters!prmDataField.Value=Fields!Length_of_Stay.Value,"G-int32"
,Parameters!prmDataField.Value=Fields!Spell_Final_Cost.Value,"C")
But it didn't work and I got the following warning back once the report had run;
Warning 1 [rsRuntimeErrorInExpression] The Format expression for the textrun ‘Textbox17.Paragraphs[0].TextRuns[0]’ contains an error: Input string was not in a correct format.'
Is it even possible to have two different number types for formatting depending on a parameter value or any other value?

VB.Net - Excel application get showing values of an range

I'm trying get an Excel Range and copy into an array of objects with Vb.Net.
This is not a problem. I use the following code:
Dim vValues(,) As Object = ExcelApp.Range(vRange).Value
And works fine; but I have a the following case:
In the column "C"; the value has a specific format and internally has another value.
My question is:
Somebody know the way to get the information exact as the user see?
I'm trying to get the information without use a For ... Each or some kind of cycle.
I'm also tried to avoid use "text to columns" function.
Both seems right solutions, but would impact the performance with a lot of data.
FYI: Also I can get the information through the ODBC connection; but I'm searching the solution using a Range
Exactly what the user sees is the Text property. But you cannot have an array of that, you will have to query each cell individually.
You are getting a Double value in your array instead of a DateTime value because you have "Time" formatting applied in Excel. If you had a format from the "Date" category, Excel would instead send a proper Variant/Date, not a Double that represents it.
Another option would be constructing the DateTime objects on the .NET side, provided you know in which columns they should be.

Resources