Questions tagged [iif-function]

IIf is a language function to perform an immediate or inline conditional assignment.

IIf is an abbreviation variously for Inline If or Immediate If and is available in many programming and script languages, IIf is implemented as a Function which means it returns a value. In code, these typically take the form:

result = IIf(condition, TruePart, FalsePart)

The value of result afterwards depends on the evaluation of condition.

A multi-line If block could perform the same action but would be an If Statement. The statement form could include any number of other actions such as invoke other methods. On the other hand, IIf simply results in a conditional assignment and cannot invoke other code.

Some languages also support a 'conditional operator', sometimes called a ternary operator, which works similar to IIf, but may offer other benefits.

94 questions
1
vote
2 answers

How to concatenate IIFs in SQL Access

What I am trying to do is to create a table where I have two columns, the second one being a clustering of the Variable1, to categorize it according to its values; if < 0.1, then I want to show "0-10", if the value is between 0.1 and 0.2, then show,…
1
vote
2 answers

SQL Server 2012: Can an IIF Function pick up the last assigned value based on a condition

Let's say I have a table that looks like this: +---------+-----------+------------+ | Company | Quantity | Date | +---------+-----------+------------+ | A | 10000 | 2016-08-01 | | B | -5000 | 2016-08-01 | | C | …
1
vote
1 answer

SUM and multiple IIF Function condition in MDX

I have written MDX query below Here what i am doing try to getting result of tom based on the multiple condition applying in IIF function : WITH SET [kpi_study] AS {[study].[study].[BHC June12]} SET [geographic] AS …
sam140
  • 219
  • 1
  • 5
  • 27
1
vote
2 answers

Sum values in RDLC with two datasets according to condition

I need to sum some values and show in RDLC. RDLC contains two datasets. There are two fields from same dataset; TipValute and Iznos. IF TipValute contains value 0 then sum all values from field Iznos. My expression looks…
Josef
  • 2,648
  • 5
  • 37
  • 73
1
vote
1 answer

Pentaho Mondrian- Hide a dimension value from a role

I am using Pentaho Mondrian to build a billing cube with the dimensions "country" and "reference". To one of my roles, I just want to show the reference value when country is equal to "Brazil". If it is not Brazil, reference should be null. How it…
1
vote
2 answers

IIf method does not work with IsDBNull(Guid.empty)

For example, Dim Test as Guid Test = IIf(IsDBNull(DataReader("ID")), Guid.Empty, DataReader("ID")) They caused an error - "Unrecognized guid format" I was trying to do if statement below If(IsDBull(DataReader("ID")) Then Test =…
1
vote
1 answer

If column A is null then use column B. If column B is null then use column C

I am using MS Access. I want to create an IIF expression where if Column A is null use column B. If column B is blank, use column C. I have gotten this so far and it doesn't seem to…
Erick
  • 13
  • 4
1
vote
1 answer

SSRS Casting makes Report Run Slow

I have seen several posts about the sum if error, but I couldn't find anything quite like this. I am working on a report that has about 9 textboxes with the expressions listed below (changed up a lil per textbox). Example 1 - this gives the #Error…
user2084896
  • 33
  • 1
  • 1
  • 5
1
vote
0 answers

SharePoint IF Function Close Survey Option

Hi I wondered if this query was within the remit of SharePoint Server 2013 or if someone can point out something quite obvious that i'm missing. I wanted to create a Survey and offer different Questions based on the answers to those questions. I…
0
votes
1 answer

Solr data-config seems to ignore my entity query to populate field

I have a database with table [objs] with a column city. I want to use that value OR if a match in table cities is found that value instead. When I run this on my database (it has just 5 records for now) it returns the desired output: SELECT…
Adam
  • 6,041
  • 36
  • 120
  • 208
0
votes
1 answer

Combining Dlookup with IIF function to check for a record

I am trying to use DLOOKUP to check another table for the current form record, and if it returns null (ie other table doesn't already have it) then to proceed with Appending the current record. I have two tables, both connected to their respective…
Zrhoden
  • 57
  • 7
0
votes
1 answer

MS Access IIF Query if Date

I'm trying to create an access query based on the date field, the query i Have which runs but doesn't populate the correct information is as follows IIf([Last Pyt Date]>DateAdd("d",-60,Date()),'Arrangement in place')) the "Last Pyt Date" needs to…
Juguete
  • 1
  • 3
0
votes
0 answers

Applying the IF function in Pandas

WHat better syntax can I use for the operation below? Column A has variables containing 2 different SI units with different conversion methods: in KB as well MB. So, I want to do the following actions on the column which is in a pandas…
0
votes
1 answer

Access Table calculated Field error: The expression couldn't be saved because its result type Binary or Null

I have TotalMarks field as ShortText because it could be a number or N/A. If [Math] value is N/A then TotalMarks is N/A otherwise sum of [Math]+[Physics] IIf([Math]="N/A","N/A",CDbl([Math])+CDbl([Physics])) [Math] and[Physics] are short text…
Stark264
  • 9
  • 2
0
votes
1 answer

Access-Calculated Field- Nested IIF

I am a newbie, I need help understanding what I am doing incorrectly. I have a calculated field in the table and the expression I have entered is pasted below I am getting an invalid syntax:- IIf([JPP-JPA_Received_Date]<=[JPP-JPA_Due_Date],"On…
Taruna
  • 1
  • 4