I need assistance writing an Derived Column expression that meets this criteria.
IF ([Name of Job] is "Accenture Leadership" OR "Senior Executive") AND [Pay scale Group] IS NOT NULL THEN [Pay scale Group] ELSE [Name of Job].
Thanks,
Try this:([Name of Job] == "Accenture Leadership" ||[Name of Job] == "Senior Executive") && ISNULL([Pay scale Group]) == FALSE ? [Pay scale Group] : [Name of Job]
reference
Related
Can someone please explain me what I am doing wrong. I don't understand the behaviour of the ifelse function in R. I expected that the ifelse function would return the whole list ids_match. However, these are the results I get with RStudio Version 1.3.1093 in the Console Window:
cond1 = FALSE
cond2 = FALSE
cond3 = TRUE
ids_match = list(1, 2, 3)
ifelse(cond1 & cond2 & cond3, ids_match[1], ids_match)
[[1]]
[1] 1
ifelse(TRUE, ids_match[1], ids_match)
[[1]]
[1] 1
ifelse(FALSE, ids_match[1], ids_match)
[[1]]
[1] 1
ifelse(FALSE, "TRUE", "FALSE")
[1] "FALSE"
ifelse(TRUE, "TRUE", "FALSE")
[1] "TRUE"`
According to ?ifelse:
Usage: ifelse(test, yes, no)
Description:
‘ifelse’ returns a value with the same shape as ‘test’ which is
filled with elements selected from either ‘yes’ or ‘no’ depending
on whether the element of ‘test’ is ‘TRUE’ or ‘FALSE’.
Now, since (cond1 & cond2 & cond3) is a single boolean variable (i.e. length(cond1 & cond2 & cond3) == 1), your response will also have length of 1.
Also see related discussion here.
I have an SP list, and have formatted the view with some JSON but on the 'Open' I want to also included IF open AND "people picker field null" Basically I'm want to hightlight something that is open an unassigned to someone
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Status] == 'Open', 'ms-bgColor-green ms-fontColor-black', if([$Status] == 'Closed', 'ms-bgColor-magentaLight ms-fontColor-black', if([$Status] == 'On Hold - 3rd Party', 'ms-bgColor-magentaLight ms-fontColor-black', if([$Status] == 'On Hold - 3rd Party', 'ms-bgColor-neutralLighterAlt ms-fontColor-black', if([$Status] == 'On Hold - User information', 'ms-bgColor-purpleLight ms-fontColor-black', if([$Status] == 'Closed', 'ms-bgColor-magentaLight ms-fontColor-black',if([$Status] == 'Request Completed Fulfilled','ms-bgColor-teal ms-fontColor-black' ,if([$Status] == 'Cancelled','ms-bgColor-yellow ms-fontColor-black', if([$Status] == 'Rejected Atlas','ms-bgColor-orangeLight ms-fontColor-black' if([$Status] == 'Rejected iHub','ms-bgColor-neutralSecondary ms-fontColor-black', ''))"
}
Any help would be cool
=if(#currentField <= #now && [$RAG] != 'Live', '#bc1010', '')"
&& is used as the and operator. In the example above, i'm looking to see if the time is now, and if the RAG column does not equal Live.
I have a Flag which needs to be set to 1 or 0. so i used Derived column transformation to convert it to bool
as you can se the code it works only when i use an OR operator for both Y and N .
This code below works for IF Flag is Y and N condition
(DT_BOOL)(Flag == "Y" ? 1 : 0) || (DT_BOOL)(Flag == "N" ? 0 : 1)
** working only when FLAG = (Capital)Y OR N *****************
but if my Flag is small 'n' it does not work it still sets to TRUE
I want to make it UPPER and TRIM it at the same time . Which i am having hard time to figure out .
This is my code but it does not work
(DT_BOOL)(UPPER(RTRIM(LTRIM
(Flag == "Y" ? 1 : 0)
)))
||(DT_BOOL)(UPPER(RTRIM(LTRIM(Flag == "N" ? 0 :1)
))) ***** this code is not working *****************
Thanks for your time.
PLEASE look at Tranformation Pic
Try this...
(DT_BOOL)(UPPER(RTRIM(LTRIM(Flag))) == "N" ? 0 :1)
I have data and series of validation (Business logic) before I can use it further. Like following :-
{
"site" : "UK",
"domain" : "xyz.UK",
"currency" : "DOLLAR",
"type" : "unlimited",
"limit" : ""
}
{
"site" : "UK",
"domain" : "xyz.UK",
"currency" : "EURO",
"type" : "limited",
"limit" : "100"
}
{
"site" : "US",
"domain" : "xyz.COM",
"currency" : "DOLLAR",
"type" : "limited",
"limit" : ""
}
Validations FLOW is like
Domain validation
Site = us >> domain = .com
Site = uk >> domain = .uk
Currency validation
Site = us >> currency = DOLLAR
Site = uk >> currency = EURO
Type validation
Site = us >> type = "only limited"
Site = us >> type = "limited/unlimited"
type = limited >> limit > 0
type = unlimited >> limit == null
So only second JSON will pass the validations. First one have wrong Currency and 3 one limit is null.
More fields will keep on adding and the validations will keep on increasing. I dont want to put the validation in JAVA code
as in I have to change the code again and again. Is there any other way to save the validations/rules and there sequence in DB and
fetch the validation/rules from DB to validate the data. If I need to change or add more I can modify DB.
Assuming that the financial data set is available as a Java bean (and that there is a typo US/UK), the third validation can be written as:
rule "check type"
when
Data( site == "US" && type == "limited ||
site == "UK" && type == "limited || == "unlimited,
type == "limited" && limit != null && limit > 0 ||
type == "unlimited" && limit == null )
then
// Data's type and limit is OK
end
This rule would "pass" the check. For determining what is wrong you'll need more rules, each of which pinpoints some fault.
I have this nested ternary expression in SSIS that I can't seem to get to work, my eyes are about to come out of my skull.
FINDSTRING(TRIM(f3),"BASICS",1) != 0 ? (UPPER(LEFT(TRIM(f3),1)) == "F" ? #[User::FallBasicsEntityId] : (UPPER(LEFT(TRIM(f3),1)) == "S" ? #[User::SpringBasicsEntityId] : #[user::BasicsEntityId])) : (UPPER(LEFT(TRIM(f3),1)) == "F" ? #[user::FallEntityId] : (UPPER(LEFT(TRIM(f3),1)) == "S" ? #[user::SpringEntityId] : #[user::DefaultEntityId]))
Here's an "indented" version:
FINDSTRING(TRIM(f3),"BASICS",1) != 0
? (
UPPER(LEFT(TRIM(f3),1)) == "F"
? #[User::FallBasicsEntityId]
: (
UPPER(LEFT(TRIM(f3),1)) == "S"
? #[User::SpringBasicsEntityId]
: #[user::BasicsEntityId]
)
)
: (
UPPER(LEFT(TRIM(f3),1)) == "F"
? #[user::FallEntityId]
: (
UPPER(LEFT(TRIM(f3),1)) == "S"
? #[user::SpringEntityId]
: #[user::DefaultEntityId]
)
)
What am I missing? It looks to me like the parentheses are balanced and properly placed.. or are they?
I'm about to ditch this and resort to a script component... it seems to me such an expression would be easier to maintain with C# code...
The parentheses are balanced; the problem is that user is not the same as User.