Division in phpexcel is not working (formula) - phpexcel

I wanted divide a cell with another cell but I got an error that says
A PHP Error was encountered.
Severity: Notice. Message: Array to string conversion. Filename:
PHPExcel/Calculations.php. Line Number: 3010.
I only wanted to divide the value of G23 by the value of H21 and assign the result in J23.
Here's my code:
$objPHPExcel->getActiveSheet()->SetCellValue('J23', '=(G23/H21)');
Any help will be greatly appreciated.

Change '=(G23/H21)' to '=sum(G23/H21)'

Related

Teradata Failing to Convert Date String to a Numeric value

I searched stackoverflow and on the internet but I could not find the exact answer. You can see my query below. I cannot figure out why I am getting the error message A character string failed conversion to a numeric value. I came to the conclusion it is that line of code because when I comment it out I don't get that error message but a different one. What I get instead is no more spool space which to me would make sense.
SELECT a.store_nbr AS club_number, a.visit_date, count(transaction_id)
FROM table_one
WHERE division = 1
AND a.visit_date BETWEEN '2020-01-01' AND '2020-02-01

PL/SQL error code PLS-00103

I wrote a PL/SQL script to output all the first name and last name of a customer but
I am getting an error
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. into bulk
Please advice. thanks
You forgot into CurrentPos on line 12.
You might also want to use a for loop instead of open/fetch/close. Save you a lot of lines of code and is the recommended way to do it by Oracle.

Extracting value from HTML table and applying assertion

I am trying to extract a value which is in integer form i.e 60.
I have a code that is going through each row and each column and then using getText() method retrieve the value from column.
When applying testNG assertEqual,the value is not matched as the value found is "[60 ]" instead of "[60]".
Output of trace:
The Text is 60
Exception in thread "main" java.lang.AssertionError: expected [60] but found [60 ]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:165)
at rough.Test.main(Test.java:83)
Can someone help me finding how I can fix the assertion?
do you in fact have a trailing space in the table?
this is an issue that is good to find in testing
perhaps you should trim the result of getText()
Maybe because your code looks something like this<td>60 </td>
You are getting that extra space. You can try something like this.
String s = node.getText().trim();
assertEqual(s, "60");

SSIS datetime trucation error

I'm using following expression in Derived Column Component to get hour and minute from datetime field. e.g. Get "12:13" from "2012-08-14 12:13:03.650"
LKPStartTime:
(DT_STR,5,1252)SUBSTRING((DT_STR,10,1252)(DT_DBTIME)StartTime,1,5)
However, it pops up error message of
"Derived Column" failed because truncation occurred, and the
truncation row disposition on output column "LKPStartTime" specifies
failure on truncation. "
Is there any problem of my expression? Thanks for any answers!
I think it should be 12,5 instead of 1,5

XQuery "The content of elements must consist of well-formed character data or markup." error on where clause

The exact error message I am getting through oXygen editor is "The content of elements must consist of well-formed character data or markup."
The part of the query that is causing the error is the following
for $top at $ind in $probSort
where $ind <= 20
return $top
According to the error message the exact text causing the error is "= 20", when I remove the "where" line the query executes perfectly and outputs the results with no error.
What exactly is going wrong because I am at a loss after two days of searching?
Thanks in advance.
--edit
First of all, i have fixed the code by changing
collection(resolve-uri("../folder_name"))
to
collection(resolve-uri("./?select=*.xml"))
which allows me to use the symbol "<=".
I wonder what makes the difference between the two version of collection(). Could somebody elaborate?
Thanks a lot.
Did you try
where $ind le 20
instead of
where $ind <= 20
?

Resources