I'm trying to write a conditional statement in the raster calculator using the "con" tool, but it keeps arriving at an error:
"Runtime error SyntaxError: keyword can't be an expression (,line 5)"
I'm trying to perform the following scenario:
If Fault_Risk is zero, then the output is simply the Bedrock_Risk, but if the Fault_Risk is non-zero, the result is a weighted equation 0.75x(Bedrock_Risk) + 0.25x(1+(Fault_Risk-1)/7).
My expression in the raster calculator is the following:
Con("Fault_Risk"=0, "Bedrock_Risk", 0.75*"Bedrock_Risk" + 0.25*(1+("Fault_Risk"-1)/7))
Any suggestions or obvious errors?
Thank you!
Related
I would like to find the distance between 2 points using Lat,Long in microsoft access.
The formula can give the result what I want but when I filter by putting condition, for example <3km or <=5km, there is always error shows 'Division by zero'.
I was trying to use Coalesce cover over Sqr part but still the same error show up
May I know which part of the equation become zero?
DIST_Km: Round(((Atn(-(Cos((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Cos((3.14*(90-[LOC_22AUG2022]![Lat]))/180)+Sin((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Sin((3.14*(90-[LOC_22AUG2022]![Lat]))/180)*Cos((3.14*([LOC_22AUG2022_1]![Lon]-[LOC_22AUG2022]![Lon]))/180))/(Sqr(-(Cos((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Cos((3.14*(90-[LOC_22AUG2022]![Lat]))/180)+Sin((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Sin((3.14*(90-[LOC_22AUG2022]![Lat]))/180)*Cos((3.14*([LOC_22AUG2022_1]![Lon]-[LOC_22AUG2022]![Lon]))/180))*(Cos((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Cos((3.14*(90-[LOC_22AUG2022]![Lat]))/180)+Sin((3.14*(90-[LOC_22AUG2022_1]![Lat]))/180)*Sin((3.14*(90-[LOC_22AUG2022]![Lat]))/180)*Cos((3.14*([LOC_22AUG2022_1]![Lon]-[LOC_22AUG2022]![Lon]))/180))+1)))+2*Atn(1))*6371),2)
I have written an expression to get gross profit margin as follows.
=IIF(Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1>0 AND Sum(Fields!AugustValue.Value, "GrossSalesDataSet")-1>0,ROUND(((Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1)/(Sum(Fields!AugustValue.Value, "GrossSalesDataSet")-1))*100,2) & "%","0.00")
it shows #Error when the Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1 and the Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1 has zero. I have handled the zero values. Someone please help men to find the error
It is your Conversion related error. You need to convert AuguestValue to your desired any numeric data type if this not in numeric. Try with following expression
=IIF(Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1>0 AND Sum(Fields!AugustValue.Value, "GrossSalesDataSet")-1>0,ROUND(((Sum(Fields!AugustValue.Value, "GrossProfitDataSet")-1)/(Sum(Fields!AugustValue.Value, "GrossSalesDataSet")-1))*100,2) & "%","0.00")
I am trying to measure distance between a line and a point using below code.
ptref = Partdocument.Part.CreateReferenceFromObject(pt1) 'creating reference from point
refline = Partdocument.Part.CreateReferenceFromObject(line1) 'creating reference from line
Get measure
TheMeasurable = TheSPAWorkbench.GetMeasurable(refline)
dist1 = TheMeasurable.GetMinimumDistance(ptref)
since line and point are at different plane, I am not getting the required output.
I want to to measure using "Any geometry, infinite option".
Please suggest how I can incorporate that.
That is not supported using the SPAWorkbench/Measurable.
As a workaround, it is not difficult to get the end points of the line and perform the calculation using vector algebra.
I am trying to duplicate a detail object from Desktop to its Webi equivalent.
I am familiar with the syntax differences, i.e. using semicolons instead of commas and using [] rather than <> to enclose references to other dimensions/measures/detail objects.
Given the working formula from the Deski report:
=ToDate(7+"/1/"+<Current FY>-1 ,"mm/dd/yyyy")
I tried to convert this using the syntax I know from Webi:
=ToDate(7+"/1/"+[Current FY]-1 ; "mm/dd/yyyy")
I faced the error message
The expression or sub-expression at position 8 in the '-' function uses an invalid data type
I am guessing this has something to do with trying to convert a date datatype into an integer in order to subtract "1." However, I do not know what kind of function this requires.
Thanks in advance!
I am writing a report in SQL Server 2005 Reporting Services, involving the division of money values that might be equal to zero. I put the following code in to check for a zero denominator:
=IIf(Sum(Fields!PreviousPremiumMTD.Value) = 0, "N/A", FormatPercent((Sum(Fields!PremiumMTD.Value) / Sum(Fields!PreviousPremiumMTD.Value))-1, 0))
However, for some reason I am still getting #Error displaying on my report with the following warning thrown:
[rsRuntimeErrorInExpression] The Value expression for the textbox ‘textbox62’ contains an error: Attempted to divide by zero.
Any assistance is greatly appreciated.
IIF evaluates the expression before passing that to function, thats why you will always get the DivideByZero error here.
See an example post: http://secretgeek.net/iif_function.asp