Questions tagged [conditional-expressions]

23 questions
1
vote
1 answer

How to write an expression for two different attributes in the same field in qlikview

Please help me write the script for the following statement in qlikview which I have it in SQL. SELECT CASE WHEN Total_A=0 THEN 0 ELSE cast(((Total_B+Total_C)/Total_A) AS decimal (5,2)) END AS ratio I have Total_A ,…
Lisa.J
  • 13
  • 4
1
vote
2 answers

How to replace values between 2 arrays in R?

I have three arrays that have the same dimensions but what I need is to replace values in dat1 by the corresponding values from dat2 when only corresponding values in dat3 are higher than 0.2. data: dat1 <- array(1:60, c(3,5,4)) dat2 <-…
Barry
  • 739
  • 1
  • 8
  • 29
0
votes
1 answer

conditional expression in jsp inside input tag

This is my code situated inside a . tm is a…
Jithin Sebastian
  • 511
  • 1
  • 6
  • 19
0
votes
2 answers

What's diverge in lisp

for example, (cond ((< 2 1) 2 )((< 1 2 ) 1)) has value 1. OK; But, I saw that (cond (diverge 1) (ture 0)) is undefined, if diverge does not terminate' in my major book. What's the diverge in lisp?? I don't know that. Also, I don't know…
StackQ
  • 99
  • 1
  • 11
0
votes
2 answers

R: Deleting Columns When Trying To Replace

I'm trying to replace NA values in a column in a data frame with the value from another column in the same row. Instead of replacing the values the entire column seems to be deleted. fDF is a data frame where some values are NA. When column 1 has…
Greg
  • 237
  • 2
  • 11
0
votes
0 answers

Conditional expressions instead of if statement

As I understand b && "" !== b && (a[b] = this); is just the same as if(b && "" !== b) a[b] = this; Are these syntax forms equivalent?
zavg
  • 10,351
  • 4
  • 44
  • 67
0
votes
2 answers

Why does the following conditional operator "?:" compile but give a run-time error

I cannot figure out why the following program compiles without warnings, but in the exception block the conditional operator gives a NullReferenceException. using System; namespace Playground { class Program { static void…
Meine
  • 53
  • 8
0
votes
1 answer

Is there a way to execute two statements based on in one line?

Is it possible to write a one line like this: if else . I don't mean something like a = 1 if 1 else 2. Example: I have a list p that in itself has lists. Let's assume I get an input inputIter. I would like to do the…
WorldSEnder
  • 4,875
  • 2
  • 28
  • 64
1
2