Evaluate method to get result for notes web view - lotus-notes

I am using evaluate function in lotusscript to get a value of certain expression.
The formula is working fine when kept in the column of a view, but as soon as it is passed in evaluate, it is throwing error as "Error in evaluate macro", might be I am using wrong suntax.
Set Eval= Evaluate({#Text(#If(#Member(#Subset(txtRejectedApprovers;-1);txtApprover1:txtApprover2:txtApprover3:txtApprover4)-#Member(#Name([CN];txtApprovedApprovers[n]);txtApprover1:txtApprover2:txtApprover3:txtApprover4)>0;"1";"0")))},foundDoc)
txtApprover1 and other fields are coming from foundDoc document.

First thing. You shouldn't use such complex evaluate statement because if there are errors or unexpected results its very difficult to find the reason.
I think your error is one bracket to much at the end of your statement. Here is the code which doesn't return the error:
Set Eval= Evaluate({#Text(#If(#Member(#Subset(txtRejectedApprovers;-1);txtApprover1:txtApprover2:txtApprover3:txtApprover4)-#Member(#Name([CN];txtApprovedApprovers[n]);txtApprover1:txtApprover2:txtApprover3:txtApprover4)>0;"1";"0"))},foundDoc)

Related

Excel VBA objsnmp.set strange things

I use the objSNMP.get method in Excel VBA without any problems.
I'd like to use the objSNMP.set method, but unfortunately it's not that easy. According to the website, it should work similarly to get, with the difference that there is one more parameter: the value to be sent.
If I try the official way:
objSNMP.Set ("43.18.1.1.2", OIDValue)
Image1
I get the message "Compile error: Syntax error".
I found another solution that works conditionally. Namely as follows (it can be seen commented out in the picture):
randomVarName = objSNMP.Set("OID", Value)
For example:
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, 21)
In this case, the code runs without error. This is interesting because I haven't found any official information about this anywhere. Somewhere deep in the recesses of the internet, I only found this possible solution some time ago.
If, on the other hand, I do not enter the value directly, but write the name of a variable there (e.g. VLANNum),
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, VLANNum)
I receive an error message. Image2
It doesn't matter if the type of the variable is not declared, string or integer. I also tried several different cell types in Excel, but nothing changed.
The error message is:
Run-time error '-2147467259 (80004005)':
The requested SNMP operation attempted to modify a variable, but
either a syntax or value error occurred.
Based on the above, I cannot insert the value read from the excel table at the end of the "objSNMP.Set" method in such a way that it can send the value. I could only solve the task if I create 4094 different "objSNMP.Set" lines and select what is necessary from among them. Not very efficient.
I have the solution. The value transferred with the variable works in the following form:
objSNMP.Set ".1.3.6.1.2.1.2.2.1.7.9", CInt(x)
Where x is the variable.

ADF adding equals condition to existing if condition

I have an if condition in an ADF activity like below:
#if(
contains(activity('LookupWmkLastUpdateConfig').output,'firstRow')
,greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
),
false)
The if condition looks as the last update date in src vs my database. Want I want to include is an additional block of code that evaluates an outside parameter called TypeLoad.
The current set-up only allows for full loads, I want to be able to include delta loads.
Does anyone know how to include such a piece of logic to the existing if code?
equals(pipeline().parameters.FwkItem['TypeLoad'],1)
The above condition would for example evaluate the full or delta load.
All help is very welcome.
Thanks!
I tried to repro this in my environment. I gave the same expression
#if(
contains(activity('LookupWmkLastUpdateConfig').output,'firstRow')
,greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
),
false)
Same error function 'if' does not accept 2 arguments is occurred.
When the expression is looked into the reason for error, there were two closing parentheses near ,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark) ) .
Same is highlighted in the above image.
one parenthesis is removed and gave the expression as in below image.
#and(equals(pipeline().parameters.fwkitem,1),if(contains(activity('LookupWmkLastUpdateConfig').output,'firstRow'),greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
,false))
Expression doesn't produce any error now.

How to correct an Excel formula error

=O27&" "&IF(D27<>"",VLOOKUP(D27,성취기준1반!$B$4:$C$19,2)&" ","")&IF(E27<>"",VLOOKUP(E27,성취기준1반!$E$4:$F$19,2)&" ","")&IF(F27<>"",VLOOKUP(F27,성취기준1반!$H$4:$I$19,2)&" ","")&IF(G27<>"",VLOOKUP(G27,성취기준1반!$K$4:$L$19,2)&" ","")&IF(H27<>"",VLOOKUP(H27,성취기준1반!$N$4:$O$33,2)&" ","")&IF(I27<>"",VLOOKUP(I27,성취기준1반!$Q$4:$R$33,2)&" ","")&IF(J27<>"",VLOOKUP(J27,성취기준1반!$T$4:$U$33,2)&" ","")&IF(K27<>"",VLOOKUP(K27,성취기준1반!$W$4:$X$33,2)&" ","")&IF(L27<>"",VLOOKUP(L27,성취기준1반!$Z$4:$AA$33,2)&" ","")&IF(M27<>"",VLOOKUP(M27,성취기준1반!$AC$4:$AD$19,2)&" ","")&P27
this is working code
=O28&" "&IF(D28<>"",VLOOKUP(D28,성취기준1반!$B$4:$C$19,2)&" ","")&IF(E28<>"",VLOOKUP(E28,성취기준1반!$E$4:$F$19,2)&" ","")&IF(F28<>"",VLOOKUP(F28,성취기준1반!$H$4:$I$19,2)&" ","")&IF(G28<>"",VLOOKUP(G28,성취기준1반!$K$4:$L$19,2)&" ","")&IF(H28<>"",VLOOKUP(H28,성취기준1반!$N$4:$O$33,2)&" ","")&IF(I28<>"",VLOOKUP(I28,성취기준1반!$Q$4:$R$33,2)&" ","")&IF(J28<>"",VLOOKUP(J28,성취기준1반!$T$4:$U$33,2)&" ","")&IF(K28<>"",VLOOKUP(K28,성취기준1반!$W$4:$X$33,2)&" ","")&IF(L28<>"",VLOOKUP(L28,성취기준1반!$Z$4:$AA$33,2)&" ","")&IF(M28<>"",VLOOKUP(M28,성취기준1반!$AC$4:$AD$19,2)&" ","")&P28
this is doesn't workin code.
Why doesn't it work?
This is not an answer in terms of a solution, but an answer in terms of the method you could employ to find and solve the issue. Mainly because you have not provided a working verifiable example, data or detail of the actual error.
First I would remove the vlookups and replace them with the expected results - if that then functions as it should then each of the vlookups needs to be tested, if not then check the detail of the function.
Appreciate if you can assist by explaining.. "why this doesn't work?" part. It is an error message or the the expected value is _ but I got _ instead.. (:
One thing I noticed is that you don't define what will be the outcome if D28 is "". If you don't define it, it'll return 'FALSE' value instead of a String/text.
In your IF() function, you only say IF(d28<>"",<DisplayValueFrom성취기준1반>) it should be IF(d28<>"",<DisplayValueFrom성취기준1반>,<DisplaySomeThingElse>)

Excel Nested IF statements returning False

I am constructing a nested IF statement, and I believe I am missing an ELSE but I cannot figure out where. I have the following statement:
=
IF(AND(B2="4",E2="R37",X2="Y"), "Non-Competing",
IF(AND(B2="4",E2="R37",X2="N"), "Competing",
IF(AND(B2="4",E2<>"R37",RIGHT(Z2,2)="00"), "Non-Competing",
IF(AND(B2="4",E2<>"R37",RIGHT(Z2,2)<>"00"), "Competing",
IF(B2<>"4","-")))))
I thought the last bit would cover the rest, but I am receiving a FALSE when I was hoping to get a result. For example, when B2=4, E2=R37, and X2=Y, I am expecting "Non-Competing" but am receiving FALSE. I also tried a combination with OR:
IF(OR(AND(B41="4",E41="R37",X41="Y"),
AND(B41="4",E41<>"R37",RIGHT(Z41,2)="00")), "Non-Competing",
IF(OR(AND(B41="4",E41="R37",X41="N"), AND(B41="4",E41<>"R37",RIGHT(Z41,2)
<>"00")), "Competing",
IF(B41<>"4","-")))
...which gives me the same result.
Any assistance would be greatly appreciated!
The missing else is in IF(B2<>"4","-"). You need IF(B2<>"4","-",<whatever last-ditch-answer>) If you are reaching False, then B2 is 4, but none of the other full conditions were met.
Without seeing your data, I can't know for sure, but I'm guessing that you may have intended that entire statement to behave as an else. If that is case, I would replace IF(B2<>"4","-") directly with "-".

VBA Excel - Macscript causing problems on windows when using IIF

I'm creating a macro that opens a file that everyone has on their computer and in order to do so must know the person's username / work ID.
To get the person's work ID I've tried using the following:
sso = IIf(InStr(Application.OperatingSystem, "Windows") = 1, Environ("UserName"), _
'MacScript("(user name as string)"))
Running this on windows returns an error because of the Macscript (I think) and I'd assume the same would happen vice versa, even though the error part of the IIF is never actually accessed I'm guessing seeing as the whole line is executed this is why there is a problem, thus On Error Resume Next would not really help here.
I know this can be easily overcome by just using an if and else statement but I just want to know if I'm right / why this problem occurs and if there are any other more sophisticated ways of achieving what I want.
Thanks
The IIF function evaluates both the true and false parts, or rather it attempts to do so. There is no short-circuit. Your assumption about why it's failing (and also that you can't use an OERN) is correct. You may take a look at conditional compilation logic, if certain parts of your code will not compile on Windows (or Mac, respectively).
http://msdn.microsoft.com/en-us/library/aa240847(v=vs.60).aspx

Resources