Hi I am getting an error
'A string is required here'
when trying the following in Crystal 2008:
If {InvPrice.SellingPrice} = 0 then "0" else
({InvPrice.SellingPrice}-ccur({?Pm-Documents/Document/Det
Can someone please give me a clue on how to resolve this?
I resolved it by removing the double quotes:
If {InvPrice.SellingPrice} = 0 then 0 else
({InvPrice.SellingPrice}-ccur({?Pm-Documents/Document/Det
Related
Hello, I have this issue in PBI and I don't understand why ?
tes2 = CALCULATE(DISTINCTCOUNT(V_PBI_EOY[DATE_YYYYMMDD]),KEEPFILTERS([#DELTA_ORG_ACTUALS_METHOD_1] > [#DELTA_ORG_ACTUALS] || [#DELTA_ORG_ACTUALS_METHOD_1] > 1.149))
Someone can help me ?
Thank you
The error says you are using a function in a boolean condition.
E.g. [#DELTA_ORG_ACTUALS_METHOD_1], which looks like a measure (function) should be a column reference ('Table'[Column]).
The issue is: I cannot figure out what the error is refering to when it diplays
Here is the error:
source_file.fs(10,5): error FS0010: Unexpected keyword 'if' in binding. Expected '=' or other token.
And I've been researching this error and proper syntax for a good while.
Now what I want to do, I hope, is obvious from the general look of the program.
Knowing the correct syntax would be great as microsofts docs are not great.
Seeing as this is case, I just don't understand what could be wrong.
open System
let one = "one"
let two = "two"
if oneortwo one then printfn one + " 1"
else printfn two + " 2"
let oneortwo(a : string)
if a = "one" then return true
elif a = "two" then return false
return false
F# is an expression based language, which means that everything has a value (returns something). F# is also statically typed, so everything returned is of a specific type.
Since everything is an expression, the return keyword is not used. The final expression in a function body is the returned value.
This goes also for if ... then ... else: every branch must return a value and be of the same type.
The correct syntax for your function is
let oneortwo a =
if a = "one" then true
else false
An excellent source of learning F# is Scott Wlaschin's site F# for fun and profit
I have a formula in my report to select a field based on requirements:
if not isnull({EXT_TBL.EXT_KEY_TYPE}) then
(if {EXT_TBL.EXT_KEY_TYPE} = "SO" and {EXT_TBL.EXT_ACTION_FLAG_9} = "Y"
then {EXT_TBL.EXT_TEXT})
else '0'
When I run the report it works ok until I try to load a specific page. When I try to load the page I get an error of 'The string is non numeric'. The formula is called in another formula:
{COR_TBL.COR_EXPECTED_DATE} + 2 + ToNumber({#FRM_NOTES})
I have ran the query on the server of:
SELECT * FROM EXT_TBL WHERE EXT_KEY_TYPE = "SO" AND EXT_ACTION_FLAG_9 = "Y";
This returned me two rows of data. I have narrowed it down to a specific entry that is causing the issue, but in the database the row has N in the field action flag 9 instead of Y so it shouldn't be throwing me the error in my report.
The action field 9 is flagged on only two records both of which contain a 7 in the EXT_TEXT feild so I have no idea why I am getting the error.
I also tried a nested if statement of:
if not isnull({EXT_TBL.EXT_KEY_TYPE}) then
(if {EXT_TBL.EXT_KEY_TYPE} = "SO" then (if {EXT_TBL.EXT_ACTION_FLAG_9} = "Y"
then {EXT_TBL.EXT_TEXT}))
else '0'
But it still gave me the same error.
Thanks
I was able to fix the issue by removing the nested if statement and just putting all the conditions in the original statement:
if not isnull({EXT_TBL.EXT_KEY_TYPE}) AND {EXT_TBL.EXT_KEY_TYPE} = "SO"
AND {EXT_TBL.EXT_ACTION_FLAG_9} = "Y"
THEN {EXT_TBL.EXT_TXT} ELSE '0'
This seems to have fixed the issue.
Both FindNoCase and Find funcions are returning 0 values for all cases. I'm working on Coldfusion 9.
<cfoutput>#Find("aaInternationalbb", "International")#</cfoutput> ->o/p:0
<cfoutput>#Find("aalbb", "International")#</cfoutput> ->o/p:0
<cfoutput>#FindNoCase("aaInternationalbb", "International")#</cfoutput> ->o/p:0
<cfoutput>#FindNoCase("aalbb", "International")#</cfoutput> ->o/p:0
Please let me know how to make this work. Thanks in advance
This is not working because you have given the parameters in wrong order. The syntax for each of find() and findNoCase() are
FindNoCase(substring, string [, start ])
Find(substring, string [, start ])
So you have to try like:
<cfoutput>#Find( "International","aaInternationalbb")#</cfoutput>
<cfoutput>#Find( "International","aalbb")#</cfoutput>
<cfoutput>#FindNoCase("International","aaInternationalbb" )#</cfoutput>
<cfoutput>#FindNoCase("International","aalbb")#</cfoutput>
This will give output as: 3 0 3 0
findNoCase and Find will expect ( stringtosearch, stringtosearchfrom [,start])
I want to display an output with Test = 0 using Fortran, I tried to use:
'WRITE(11,*) 'Test =' testdata'
Assuming 11 is correct and testdata is a parameter that is being calculated.
I wasn't able to get the output and there was an error.
Anyone have any idea why it is so?
Try inserting a comma and deleting the apostrophes:
WRITE(11,*) 'Test =', testdata
If you had reported what the error message you saw was I might have made this answer more apposite.