OK, I have a query that pulls in a field (pay period) which is alphanumeric. In my report, I need to divide by a substring of this field. So, what I need to do is take a substring of pay period, and then perform a ToNumber function on it so that I can use it in a calculation.
To do this, I create a variable that substrings it, then create a second one that changes that new variable to a number. I then try to use that variable in a calculation and I receive the #COMPUTATION error. I’ve used similar logic in other reports and it’s worked fine. Any ideas on what I may be doing wrong? Thank you in advance, this is KILLING me!
=Sum() Where (=2004) it’s working fine when i take user responce insted of 2004 it’s giving syntax error
=Sum() Where (=ToNumber(SubStr(UserResponse (“Query 1” , “Enter Year & month YYYY/MM”) ,1 ,4))) --this is throwing an error
Take a look at our FAQ: Reporter and you’ll find this entry.
I’m surprised that the “>=” even works – perhaps you’re on a newer version? Traditionally, the SUM (WHERE…) required that the operator needed to be an equal sign.
And, the operand to the right required a constant or a variable – no functions. So try creating a new variable called whatever you want, I"ll pick “X”:
X =ToNumber(SubStr(UserResponse (“Query 1” , “Enter Year & month YYYY/MM”) ,1 ,4))
Hi Anitha,
I created exactly what u said here but it still giving syntax error
X =ToNumber(SubStr(UserResponse (“Query 1” , “Enter Year & month YYYY/MM”) ,1 ,4)) from this variable i am getting 2004,if i hardcode in place of X it’s working fine but if i use variable insted of X giving error.
=SUM(MTD Shipped Cases) Where (J Fiscal Year Id= X)
Thanks Mario.
Actually this is a cross tab report if i use =If J Fiscal Year Id=X Then MTD Net Dollars giving me #computation error
if i included J Fiscal Year Id in cross tab then it’s giving multival error