What does 'APPLY' or 'APPLY FOR' condition mean in sequence? - webmethods

Can anyone please help me understand what will the sequence check for value field or what does 'APPLY' and 'APPLY FOR' mean?

This is a simple string comparison. You check if the variable "value" equals the string "APPLY" or (double pipe ||)"APPLY FOR".
The two BRANCH steps below the sequence with your condition do not make sense. Neither does the comment at the first branch, since the condition is clearly not checking for digits only.

Related

"Does Not Exist" (DNE) property filter for Keen IO analysis calls

I'm trying to write a query against my Keen IO collection of pageviews, I really need a particular property to be filtered out. That is a filter for whenever a referral_URL "does not exist" (DNE).
I noticed there is a full list of other filter operations, but no DNE. I tried "Equal to" "Null" but it didn't do it for me.
List of Filter Operations: https://keen.io/docs/api/#operator-definitions
Is this possible?
Use the "Property Exists" operator. You will find it about half-way down the list of operators in your screenshot.
However, once you select that operator, you will see the value on the right default to "True". This would actually be the opposite of what you're after. To get DNE, you need to set the boolean value to "False".
You're correct in your findings that the "Equal to" "Null" doesn't work in the same way as DNE. Behaviorally, that is a string comparison, so events that do not have a value will not satisfy that filter.

Conditional Split Explained

Trying to understand what the following conditional split expression is trying to do:
ISNULL(Employee_ID_WD) || (RIGHT(REPLACENULL(Employee_ID_WD,"0"),LEN(REPLACENULL(Employee_ID,"0"))) != REPLACENULL(Employee_ID,"0"))
I am new to SSIS, can anyone explain this?
It’s a relatively straight forward expression when you break it down.
To put it succinctly (tl;dr), if the Employee_ID_WD is null OR the Employee_ID value is not in the Employee_ID_WD value, then return true. Otherwise, return false.
Details:
The first part, ISNULL(Employee_ID_WD), checks to see of the Employee_ID_WD is null. If it is, the expression will return true, right away. The reason for that is the || right after. This is called a logical or. If you see this in many programming it indicates that the programmer wants to the expression to return right away if any part of it before the || is true. In other words, if something before the || is true, start doing what I need you to do, there is no sense in checking anything in this expression, I know what I need to know in order to move on. This is referred to as short-circuit evaluation. Wiki.
If the Employee_ID_WD is not null, we move on to the next part of the expression.
This part:
(RIGHT(REPLACENULL(Employee_ID_WD,"0"),LEN(REPLACENULL(Employee_ID,"0")))
is grabbing the characters on the right side of the Employee_ID_WD. The number of characters it is asking for is what is returned from the LEN (length) function being run on the Employee_ID. Also, both parts of this are checking if the value they pass in is null, as indicated by the REPLACENULL function. If they are null, a string with the value 0 is returned. This is done in case one of the values are null, this way you get a true value comparison. Using the REPLACENULL function in all parts of this expression makes it that much more robust, meaning inconsistencies with data will be handled without something error-ing out, or giving in consistent results in the end.
The results from the part above are compared to REPLACENULL(Employee_ID,"0"). If the part above and this are not equal (!= is not equal to), then the expression returns true.
SSIS Expression Reference

SSRS Count or Sum expression

I cannot work out why these Total expressions don't work...
I am trying to add any cells that have a date later than today, with any cells that have "Not Reqd", and then divide that by the number of rows, to get a percentage.
All I'm getting is #Error.
These are the expressions I've tried:
=SUM(IIf(Fields!Jetter_Trng.Value >Today OR
Fields!Jetter_Trng.Value = "Not Reqd",1,0)))/(Count(Fields!Jetter_Trng.Value)
and
=Count(IIf(Fields!Jetter_Trng.Value >Today OR
Fields!Jetter_Trng.Value = "Not Reqd",1,Nothing)))/(Count(Fields!Jetter_Trng.Value)
The "Not Reqd" string has come from an expression that changes a date (01/01/1950) to "Not Reqd". Maybe this is messing things up:
=iif(Fields!Jetter_Trng.Value = "01/01/1950", "Not Reqd", Fields!Jetter_Trng.Value)
The current working expression (not looking for "Not Reqd") is:
=COUNT(IIF(Fields!Jetter_Trng.Value>Today,1,Nothing)))/(Count(Fields!Name.Value))
I'm a bit lost...
A couple of notes on your expression as it stands at present
Jetter_Trng appears to be a string representing either a date or “Not Reqd”. You can’t compare strings to dates without casting them to a date type first using CDATE()
The number of braces (( and )) do not match
The root of your problem though is that you are using Jetter_Trng to return either a Date, or the value “Not Reqd”.
When SSRS attempts to evaluate an expression it does it all at the same time. It doesn’t follow a path to find the answer, and ignore other paths. Therefore, when you are attempting to compare
Fields!Jetter_Trng.Value >Today
This is comparing a string to a date, and throwing the error, as this mean nothing
"Not Reqd" > Today
You won’t be able to do all that you want to using only one Field of type string.
Your options are to
Use two fields – the date and a flag indicating not required, or
Use one field – but have an “invalid date” (01/01/2100 perhaps) that you could then treat as the “Not Reqd” value, and check if the current date is less than that (which it always will be)
Using the second option here you could then use the following expression to create the desired calculation
=sum(iif(CDate(Fields!Jetter_Trng.Value) > Today, 1, 0)) /
Count(Fields!Jetter_Trng.Value)
Which would evaluate this dataset as follows

Building an IIF statement with a Yes/No Field

I'm trying to do a calculation to refer back to a field if another field Yes and I keep getting the #Type! error.
The fields are [Written] which contains a currency total, [LR Test] which is the Yes or No field and [Written totals]. So basically what I want my expression to do is IF LR Test = Yes I want [Written Totals] to show the amount from the [Written] field, IF it's a No, then it could be Null or 0.
This is the calculation I have tried that returns with #Type!
IIf(([LR Test]=Yes),[Written],Null)
Any help or advice is greatly appreciated. I'm very new to access so it has been quite a struggle.
If your [LR Test] field is of the type "Yes/No", you can refer to it with True False.
IIf([LR Test]=True,[Written],Null)
This would also work, since Access stores a true value as a -1 under the covers
IIf([LR Test]=-1,[Written],Null)
Yes/No fields in MS Access are actually Boolean fields, as already mentioned by Josh in his answer.
So because [LR Test] is a boolean value by itself, you don't need to compare it to anything to get Iif to work.
This is enough:
IIf(([LR Test]),[Written],Null)

Format phone number and hide #ERROR when return is null SSRS

I'm having an issue and everything i've tried doesn't work. I have a phone number datafield that returns numbers with no formatting '3055558798' but i want it to look like this '(305)555-8798'. I can get that done with this expression:
= Format(Convert.ToDouble(Fields!MyFieldName.Value), "(###)###-####")
The only issue is that when the return is null i get #ERROR in the space. I found an expression that got rid of the #ERROR but still no luck putting them both together. I would have to dig through my reports to find the expression but hopefully someone can help me. I've been doing reports for a couple of months but i'm still not very good with all the expressions that there are. I just need to format the phone number and if the return is null then not show anything. There's also this on the same site that i found the expression but it doesn't work so i dont know why the guy said it worked for him.
=Iif (Fields!MyFieldName.Value Is Nothing, Nothing,
Format(Convert.ToDouble(Fields!MyFieldName.Value), "(###)###-####"))
That just doesn't work for me, I believe the syntax is wrong but i don't know what to change to fix it. Thanks.
The error you have got is nothing to do with formatting, it is the conversion to Double that is failing. So your expression works perfectly as long as your field consists entirely of numeric characters. However, you have some data with non-numeric characters in it, causing the Convert.ToDouble() function to throw an error.
Unfortunately this can not be solved with an IIF expression because IIF is a function, not a language construct so both the true and false parameters get evaluated before being passed to the function regardless of the value of the boolean condition parameter. This means that:
=IIF(IsNumeric(Fields!Phone.Value), Format(Convert.ToDouble(Fields!Phone.Value), "(###)###-####"), Fields!Phone.Value)
will always attempt the conversion to double regardless of the result of the IsNumeric function. There are two ways to solve this:
Use Val instead of ToDouble
The problem with ToDouble is it errors when the string to be converted is an inappropriate form; Val doesn't have that problem - it simply grabs whatever numbers it can. So now we can use the expression:
=IIF(Fields!Phone.Value Is Nothing,
Nothing,
IIF(IsNumeric(Fields!Phone.Value),
Format(Val(Fields!Phone.Value), "(000)000-0000"),
Fields!Phone.Value)
)
(Use 0 rather than # so that leading zeroes aren't suppressed)
This expression returns Nothing if the field is Null, checks to see if it is numeric and if so converts it to a number and formats it, otherwise it just returns whatever is in the field.
Note that the Val function is still being run even when the field is not numeric but this expression succeeds because the Val function doesn't raise errors like ToDouble. We simply make the calculation and discard the result.
Custom code
On the Report menu, click Report Properties... and go to the Code tab. Insert the following code:
Function FormatPhone(Phone AS String) AS String
IF (Phone Is Nothing) Then
Return Nothing
Else If (IsNumeric(Phone)) Then
Return Format(Convert.ToDouble(Phone), "(000)000-0000")
Else
Return Phone
End If
End Function
Use the following expression in your phone number cell:
=Code.FormatPhone(Fields!Phone.Value)