Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [conditional-statements]

"In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false. Apart from the case of branch prediction, this is always achieved by selectively altering the control flow based on some condition." -- Wikipedia

conditional-statements
0 votes
1 answer
19 views

How to streamline else if statements in Power Query M for a new Add Conditional Column

I created a new Conditional Column named [CATEGORY] based on many different values in a column named [MERCHANT]. I'm categorizing the values in the MERCHANT columns. Many of the values in MERCHANT ...
shirlgirl's user avatar
0 votes
0 answers
9 views

How to set exception for URL with certain parameters in a string (REACT)

I am trying to conditionally render JSX element and looking for a way to exclude any URL that has a subpage in it. see example: eg. "/blog/some-parameter" <div> {/* Conditionally ...
timber535's user avatar
  • 435
-7 votes
0 answers
34 views

What is the purpose of assignment operator used in conditional statements in JavaScript? [closed]

In python, conditional statements(If-else) takes only True/False in its expression field. i.e, a = 3 b = 5 if (a==b): # any relational expressions print(a, b) But, in JavaScript, conditional ...
Srivikas Mathesvaran's user avatar
0 votes
1 answer
32 views

React conditional rendering and smooth animations/transitions

What is the proper/most efficient way to achieve smooth animation with conditional rendering a component in React? I read on other posts that one of the ways to achieve this is to have a state and set ...
Tarek-Dev's user avatar
  • 170
0 votes
0 answers
18 views

How do I find a word in a string in Pinescript?

I am trying to use the following code and it is saying "Could not find function or function reference 'str.contains". r= "RSI", cond = str.contains(divergence_text_bottom,r) Thanks ...
OnePlusTwo's user avatar
1 vote
2 answers
50 views

How to select the row with specific condition and the row just above? [closed]

Here is how I defined my condition , but I need the row just above as well. There are many observations per ID. data2<- data2 %>% group_by (ID_number) %>% filter(time_diff_hour > 8....
Asma's user avatar
  • 13
0 votes
0 answers
8 views

How can I set an alert on a condition met in an array in Pinescript

I have an array that is being set with divergences. What I want to do is add a conditional statement for IF the array contains cwmacd and macd together and another one that checks IF the array ...
OnePlusTwo's user avatar
2 votes
4 answers
95 views

Conditional mutate based on order of variables

I have vectors that index the events A, B, C. Each event occurs at least once but can occur multiple times. For example: Sequence 1: c("A", "B", "C") Sequence 2: c("...
gregor-fausto's user avatar
-1 votes
1 answer
31 views

Using multiple conditions using bash Test [duplicate]

I'm using the following bash Test for one condition and it's working correctly [[ $# == 1 ]] || { echo "Syntax: $0 arg1"; exit 1; } But when I try to use 2 conditions like the following: [[ ...
Diego Alejandro Gómez Pardo's user avatar
1 vote
1 answer
31 views

MS Excel - Count rows where multiple columns meet different criteria

I am trying to automatically count samples that pass or fail based on multiple criteria. Countifs works beautifully for the pass condition where all criteria must be passed, but I'm struggling with ...
brummel's user avatar
  • 51
-1 votes
4 answers
62 views

removing values in pandas according to condition

In pandas dataframe I want to remove the row with duplicate employee id but accoridng to the condition where the salary is null my original data is EEID Name gender salary 0 EMP01 ayushi ...
vasu's user avatar
  • 1
0 votes
0 answers
9 views

Configure check for multiple condition

ALL, I have 3 different options to check with configure: --with-X1 --with-X2 --with-X3 If tye user is not supplying any of them I want to output a warning stating that the default value will be used. ...
Igor's user avatar
  • 5,907
0 votes
0 answers
43 views

what is the better way to add conditional routing in rails

I have to change the route in a way that I need to have the original route as well as change the path of the route in a env is available. this is how I am thinking of doing custom_org = ENV['...
Burhan Gardezi's user avatar
0 votes
0 answers
41 views

How to call an R function conditional on a printed string?

I'm using the tesseract package to mine text from a very large (>500K) set of scanned documents. Some of the documents are rotated the wrong way, so when I call tesseract::ocr on those, the ...
Jake's user avatar
  • 117
0 votes
1 answer
19 views

Replicating IF ANY conditional logic or a SUMIF Equivalent in PeopleSoft Query

Setting up an expression with conditional logic to determine the type of requisition within our business logic. Some requisitions can have multiple REQ_LINE.LN_TYPE (e.g. Req Line 1 = CAT & Req ...
Aher's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
1290