How to prefix the number to a column which has data type "double-precision float [DT_R8]" in SSIS using "derived Column" - ssis-2012

I have a commission table which has the column Invoice Number with data type as double-precision float [DT_R8].
I want to prefix the number 71 to the Invoice Number column using Derived Column transformer in SSIS.
I tried writing expression like
"71" + [Invoice Number]
It showing the error message:
Can anyone help me solving this?

Related

Convert text to equation and return the sum result in Google Sheets

Let's say I have text in the following format in Column A imported to another spreadsheet (impossible to add = manually because the data is imported automatically and change):
45+5
45+3
90+2
90+7
Is there any formula that can convert this text into an equation that gives the result of the sum in Column B?
For example:
=ARRAYFORMULA(FUNCTIONTOCONVERTTEXTTOEQUATION(A1:A))
Expected Result:
50
48
92
97
Note: The texts will always be a number after the + sign and then another number.
Given your response to my clarifying question above, let's assume that your raw data is in A2:A. Place the following in the Row-2 cell (e.g., B2) of an otherwise empty column:
=ArrayFormula(IF(A2:A="",,MMULT(IFERROR(TRIM(SPLIT(A2:A,"+"))*1,0),SEQUENCE(COLUMNS(SPLIT(A2:A,"+")),1,1,0))))
MMULT is a powerful yet underused function. I'll include a graphic that explains what it does better than words might:
SPLIT will form the elements of the first matrix, while SEQUENCE will simply create the second matrix consisting of a column of 1's the same length as the number of horizontal elements formed by the SPLIT (which, in your case, will apparently always be 2).
Try, assuming the imported data starts at A1
=arrayformula(sum(value(split(A1,"+"))))
or, in a single formula at the top of the column
=mmult(arrayformula(value(split(A1:A4,"+"))),sequence(2,1,1,0))

Calculate Total row Averages correctly if table columns contain empty cells

I am using the following formula to calculate a Total row that calculates averages for percentages in the columns. However, since the data contains some empty values, the averages calculated is not correct.
={"TOTAL",arrayformula(transpose(query(transpose(query({(B16:M19)},"Select " & TEXTJOIN(",",true,arrayformula(if(filter($B$15:15,$B$15:15<>false),"Sum(Col" & Column($B$15:$M$15) - Column(B$15) + 1 & ")/Count(Col" & Column($B$15:$M$15) - Column(B$15) + 1 & ")"))))),"select Col2 format Col2 '0.00%'",)*100%))}
Ocassionally, I also get errors in my production spreadsheet viz.,
Unable to parse query string for Function QUERY parameter 2: AVG_SUM_ONLY_NUMERIC
or
Unable to parse query string for Function QUERY parameter 2: TypeError: Cannot read property 'get' of undefined
These go away if i coerce the range like this:
(B16:M19)+0 .... or.... N(B16:M19)
But this results in the average calculated incorrectly as the average considers the 0's that get replaced or the empty cells now. How can this be avoided and the values calculated correctly?
P.S: i had to hardcode the range as i don't know how to make this formula more dynamic. If anyone has an idea, please do share with me.
Here is the sample sheet. FTR Table
I came up with this formula, for your total values. See B23 in your Tables sheet:
=IFERROR(SUM(B16:B19)/COUNT(FILTER(B16:B19,B16:B19>0)),0)
If this tests out okay for you, I can try to see if it can be developed as an arrayformula.
It just sums each column in the table, and divides that by the count of values in the table that are greater than zero, so it excludes both blanks and zeroes in the table.

Formula for tabulating daily running counts of a given column

I'm trying to write a formula that gives a running count of Issues for a given day. In other words: the output should enumerate each Issue for a given date (returning blank if Issue is blank), and then start again at 1 for the first issue in a subsequent date.
I've hard-coded the expected outputs in the "desired output" column (column I):
Sample dataset is in this sheet. Key pieces:
Column B contains the date
Column E contains the T-shirt size severity of each Issue
Column F contains a numerical translation of column E
Column G contains a binary output of whether there was an Issue
In my attempt (column J), I've gotten close using
=ArrayFormula(MMULT((ROW($B3:$B)>=TRANSPOSE(ROW($B3:$B))) * EXACT($B3:$B,TRANSPOSE($B3:$B))^1, ($G3:$G)^1))
...but it's not quite what I want, as:
this repeats values instead of giving blanks (e.g. row 8, 11)
this gives 0s instead of giving blanks (e.g. row 3, 4)
See Validation (column L).
Any ideas on how to get to what I'm looking for?
Just wrap your formula in the IF function
=ArrayFormula(IF(F3:F="",,YOUR.....FORMULA))
In other words
=ArrayFormula(IF(F3:F="",,
MMULT((ROW($B3:$B)>=TRANSPOSE(ROW($B3:$B))) * EXACT($B3:$B,TRANSPOSE($B3:$B))^1, ($G3:$G)^1)
))

SQLPlus prevent column from being padded to its column name's length

I have a query that I need formatted in a particular way, but when I have an 8-character string with a 12-character column name, it pads the column to 12 characters even with Set Heading Off and Set Pagesize 0. Is there a way to display a column such that it will not include the length of the column name when calculating the width to use?
This is not the same as "SQLPlus varchar2 outputs whitespaces", which does not appear to be asking about the case when the column name is longer than the data name - just when the data appears to have an excessive length.

Unable to Parse Formula Using MINUS Function in Google Sheets

I have two columns in a Google spreadsheet. One column ("amountPaidByBuyer" or column "G") contains the amount buyer paid for product. The second column ("cost" or column "J") contains the amount our company paid for the product. I have a 3rd column ("ROI") which should contain the difference between the cost and the amount paid by buyer (for example, if cost is 10.99 and the buyer paid 11.99 then the ROI is +1.00. If the cost is 10.99 and the buyer paid 9.99 then the ROI is -1.00).
Since I'm simply subtracting two columns from the same row (G - J) I tried inserting the following formula:
=MINUS(G ROW(),J ROW())
This was done based on the following answer which suggests using the ROW() function to get the current row automatically (instead of needing to specify this value in the formula).
However, this leads to the following error: Formula parse error.
Google does not provide any additional details about the error.
What is wrong with the formula?
If you want to use minus and row(), this will work:
=minus(indirect("G"&ROW()),INDIRECT("J"&ROW()))
But why not use:
=G2-J2
Change the row to where you start then drag the formula down for rows below.
What’s wrong with the formula is too much for Sheets’ help features to cope with:
i. MINUS requires numeric parameters and G ROW() is not numeric.
ii. G ROW() is merely a string of characters, including a space. In Excel, for example, a space may be an intersect operator – but space does not function as such here. (Even with the update a few minutes ago Sheets does not have an intersect operator.)
iii. To combine a column reference with a row reference to make a cell reference concatenation is required (eg use of & operator).
iv. But G&ROW() does not work because Sheets does not recognise G as a column name, without quotes round the G (unless a column has been given the range name of G).
v. "G"&ROW() returns a cell reference, but not the value in that cell, so not the numeric parameter required by MINUS.
vi. To interpret the cell reference as the value within the cell a function like INDIRECT is required.

Resources