Multiple IIF Statements in SSRS Expression
Team:
The following IIF expression works:
=IIf(Fields!Court.Value = "MA", "Total Filed: Daily = "&Fields!MAFiledDaily.Value, Nothing)&
IIf(Fields!Court.Value = "MA", " | Monthly = "&Fields!MAFiledTotal.Value, Nothing)
However; I have 10 additional Court.Values for the IIF statement to check and return results.
I have tried the following with no luck ("OR" added):
=IIf(Fields!Court.Value = "MA", "Total Filed: Daily = "&Fields!MAFiledDaily.Value, Nothing)&
IIf(Fields!Court.Value = "MA", " | Monthly = "&Fields!MAFiledTotal.Value, Nothing)
or
IIf(Fields!Court.Value = "MB", "Total Filed: Daily = "&Fields!MBFiledDaily.Value, Nothing)&
IIf(Fields!Court.Value = "MB", " | Monthly = "&Fields!MBFiledTotal.Value, Nothing)
Any help would be welcomed.
Regards,
jer
jer
You have to nest the IIf statements which looks a bit messy but the only other way would be to alter your dataset to return the extra text you need with a case statement.
=IIf(Fields!Court.Value =
"MA",
"Total Filed: Daily = "&Fields!MAFiledDaily.Value, IIf(Fields!Court.Value =
"MB",
"Total Filed: Daily = "&Fields!MBFiledDaily.Value,
Nothing))&
IIf(Fields!Court.Value =
"MA",
" | Monthly = "&Fields!MAFiledTotal.Value, IIf(Fields!Court.Value =
"MB",
" | Monthly = "&Fields!MBFiledTotal.Value,
Nothing))
Similar Messages
-
Writing an IIF Statement in SSRS using IN or LIKE
Hello,
I am trying to write an IIf statement with multiple conditions and I am getting an error. Here is the current syntax:
=IIf(Fields!role_sk.Value=4174 AND Fields!settle_type_sk.Value
LIKE (4159,4160), Fields!company_name.Value,"")
Here is the error:
Any ideas? I think it has to do with the LIKE.
ThankThe syntax on the Like is incorrect. The Like operator expects a string to compare to that uses an * as a wildcard for any character(s).
=IIf(Fields!Name.Value Like "F*", Fields!Name.Value, "Not F")
This will display the name field if it starts with an "F" or "Not F" if not.
The "In" operator is not available in expression builder but is available in filters (Tablix, Group, etc.). To use that, the Value must be an array. You can create
an array of static text using the Split function in expression builder.
=Split("Me,You,Them",",")
This creates an array with 3 elements:Me, You, and Them. If any are matched in the field or expression you are comparing to in the filter, the record will be displayed,
otherwise not.
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
I have a question whether I am using the correct IIf statement in SSRS?
I have created a report with columns for case name, date opened, staff assigned, title, contact date, created by, and comments. I also have selected the comment_type field for the sake of indicating which data to pull but it will not be listed on the report.
I have the following IIf statement which indicates that if the comment_type is NOT equal to 4322 then I want it to return NOTHING (or a blank line, one line ONLY, not repeated ugh) and if it IS equal to 4322 then that's the information I want to be placed
on the report for created by, contact date, and comment fields.
=IIf(Fields!comment_type_sk.Value <> 4322, Nothing, 4322)
Now, the problem is, I want the report to generate as below and I'm not sure where to place this in order for it to render correctly. If the comment type 4322 is present then print the information in the last three columns, if it is anything but that,
then just a blank line where those fields are. The report itself is to be pulled on dated opened. SO...I'm not sure if this code should go under a parameter? or if it should just be stated in the expression for each of those fields? PS I am teaching myself
SQL. Sorry for the lack of knowledge.
Smith, Joe 1/1/2007
Jones, Tom Lead Atty 1/28/2013 MJohnson Set up meeting
Franz, Joseph 3/15/2008
Grouch, Oscar Lead Atty
Jones, Paula 2/16/2013
French, Mary Partner 2/20/2013 DFalk Atty Introduction
Thanks,
DawnHi,
You can place the IIF statement in the 3 columns. You do not need a parameter.But the iif statement in the last 3 columns should be similar as below
Col1 - iif(Fields!comment_type_sk.Value <> 4322,
Nothing,col1)
Col2 - iif(Fields!comment_type_sk.Value <> 4322,
Nothing,col2)
Col3 - iif(Fields!comment_type_sk.Value <> 4322,
Nothing,col3)
HTH,
Ram
Please vote as helpful or mark as answer, if it helps -
Trouble with IIF statement in SSRS report builder
hi....
I have an expression field that isn't working. They are Dynamics GP tables, and I am trying to show converted currencies:
=IIF (Fields!Currency.Value=RTrim("Z-US$"), Fields!ORCPTCOST.Value
, Fields!ORCPTCOST.Value / CDEC(Fields!ExchangeRate.Value))
The true part is bolded. when the report shows, it always comes up as
#Error. If the currency is "Z-MXN$", it calculates it fine.
So why is my true part not working?
thanks!
~georgeHi George,
Based on my research, this issue can be caused by
IIF is not an expression, it is a function with three parameters:
IIF(Condition, ValueIfTrue, ValueIfFalse)
Note that all parameters are evaluated before being passed to the function. We can still get an error, because the erroneous expression is still evaluated even when the condition should mean that it
isn't. For example, when the currency is "Z-US$", the ExchangeRate field returns
a stream of letters which cannot be changed to decimal type. Or the ExchangeRate field returns 0, then the denominator is 0, the division makes no sense. So it displays #Error.
To fix this issue, we can assign a value that doesn’t affect the expression result to ExchangeRate field when it is
a stream of letters or equal to 0. The expression below is for your references:
=IIF (Fields!Currency.Value=RTrim("Z-US$"), Fields!ORCPTCOST.Value , Fields!ORCPTCOST.Value / CDEC(iif(IsNumeric(Fields!ExchangeRate.Value)=false or Fields!ExchangeRate.Value=0, 1, Fields!ExchangeRate.Value)))
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
How to convert switch statement into iif than else statement in SSRS
Hi All;
How do i convert switch statement into iif statement in ssrs
=
Switch(
Fields!createdonValue.Value = Now(), "Today",
Fields!createdonValue.Value = DateAdd("d",-1,Today()),"Yesterday",
Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -6,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Week",
Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -13,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Fortnight",
Fields!createdonValue.Value >= DateValue(DateAdd("M",-1,DateAdd("D",-(Day(Now)-1),Now))) and
Fields!createdonValue.Value <= DateValue(DateAdd("D",-1,DateAdd("D",-(Day(Now)-1),Now))),"Last Month",
Fields!createdonValue.Value >= DateSerial(Year(Now()), 1, 1) and
Fields!createdonValue.Value <= DateSerial(Year(Now()), 12, 31),"Year to Date"
Any help much appreciated
Thanks
Pradnya07Not sure why you want to se IIF as Switch is more compact
Anyways it will look like this
=IIf(
Fields!createdonValue.Value = Now(), "Today",IIf(
Fields!createdonValue.Value = DateAdd("d",-1,Today()),"Yesterday",Iif(
Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -6,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Week",IIf(
Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -13,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Fortnight",IIf(
Fields!createdonValue.Value >= DateValue(DateAdd("M",-1,DateAdd("D",-(Day(Now)-1),Now))) and
Fields!createdonValue.Value <= DateValue(DateAdd("D",-1,DateAdd("D",-(Day(Now)-1),Now))),"Last Month",IIf(
Fields!createdonValue.Value >= DateSerial(Year(Now()), 1, 1) and
Fields!createdonValue.Value <= DateSerial(Year(Now()), 12, 31),"Year to Date")))))
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
All,
I have the below IIF statement in SSRS report based on a sharepoint list. However I get #Error only on certain lines
For example when Item_Name = P001-P384D630Z01
I am sort of stunned at this point. All the other lines work except the one with above item name. If I remove the MF5 Mod Center part of the iif then everything works.
=
Iif((mid(Fields!Item_Name.Value,8,1)= 3 OR mid(Fields!Item_Name.Value),8,1)=4) AND LEFT(TRIM(Fields!Project_No.Value),1) =8, "MF5 Mod Center",
Iif(Left(Fields!Project_No.Value,1)="3","HOU MOD",
Iif(Left(Fields!Item_Name.Value,3) = "RDC","RDC",
Iif(Left(Fields!Item_Name.Value,4) = "P001","Overseas",
Iif(IsNothing(Fields!Engineering_Status.Value), "Pre-engineering",
Iif(Fields!Engineering_Status.Value="P.C. Finished", "Production",
Fields!Engineering_Status.ValueIt's working after removing the "-" in the item_name if anyone is wondering.
=
Iif(Left(Fields!Project_No.Value,1)="3","HOU MOD",
Iif(Left(Fields!Item_Name.Value,3) = "RDC","RDC",
Iif(Left(Fields!Item_Name.Value,4) = "P001","Overseas",
Iif(IsNothing(Fields!Engineering_Status.Value), "Pre-engineering",
Iif(Fields!Engineering_Status.Value="P.C. Finished", "Production",
Iif((mid(replace(Fields!Item_Name.Value,"-",""),8,1)= 3 OR mid(replace(Fields!Item_Name.Value,"-",""),8,1)=4) AND LEFT(TRIM(Fields!Project_No.Value),1) =8, "MF5 Mod Center"
,Fields!Engineering_Status.Value -
Multiplying 2 values based on an If statement in SSRS reports
I am working on a pretty complicated report, and I am unable to get the values to multiply correctly on one line. The expression is simple, if the value in textbox293 is greater then the value in textbox294 then multiply textbox293 by textbox289 else
multiply textbox294 by textbox289.
In SSRS terms IIF(textbox293.value > textbox294.value, textbox293.value * textbox289.value, textbox294.value * textbox289.value)
I am using the actual formulas that I used to get the values, they have a nested IIF statement to return 0.00 if the value is less < 0. I am also rounding to 6 decimal places on 1 value to ensure I get the correct value out to 4 decimal places.
I have checked all of the value on the report up to this point are correct, and are displaying correctly. I have broken apart my IIF statement to make it easier to read:
=IIF(IIF((Sum(Fields!RSR_MIN_2.Value, "Revenue") + IIF((Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance"))
* (Sum(Fields!RGF_MIN_2.Value, "Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value,
"End_Fund_Balance")) * (round(Sum(Fields!RGF_MIN_2.Value, "Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"),6))))/(First(Fields!WADA2011_1.Value, "Second_Year_Preceeding_WADA")) < 0, 0.00, (Sum(Fields!RSR_MIN_2.Value,
"Revenue") + IIF((Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance")) * (Sum(Fields!RGF_MIN_2.Value, "Revenue")
/ First(Fields!RGF_MIN_2.Value, "Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance"))
* (round(Sum(Fields!RGF_MIN_2.Value, "Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"),6))))/(First(Fields!WADA2011_1.Value, "Second_Year_Preceeding_WADA")))
>
=IIF((Sum(Fields!RSR_MIN_1.Value, "Revenue") + IIF((Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(Sum(Fields!RGF_MIN_1.Value,
"Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(round(Sum(Fields!RGF_MIN_1.Value,
"Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"),6)))) / (First(Fields!WADA2012_1.Value, "Second_Year_Preceeding_WADA")) < 0, 0.00, (Sum(Fields!RSR_MIN_1.Value, "Revenue") + IIF((Sum(Fields!SR_MINUS_1.Value,
"Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(Sum(Fields!RGF_MIN_1.Value, "Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"))<
0, 0.00, (Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(round(Sum(Fields!RGF_MIN_1.Value, "Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"),6))))
/ (First(Fields!WADA2012_1.Value, "Second_Year_Preceeding_WADA")))
IIF((Sum(Fields!RSR_MIN_2.Value, "Revenue") + IIF((Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance")) * (Sum(Fields!RGF_MIN_2.Value,
"Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance"))
* (round(Sum(Fields!RGF_MIN_2.Value, "Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"),6))))/(First(Fields!WADA2011_1.Value, "Second_Year_Preceeding_WADA")) < 0, 0.00, (Sum(Fields!RSR_MIN_2.Value, "Revenue")
+ IIF((Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance")) * (Sum(Fields!RGF_MIN_2.Value, "Revenue") / First(Fields!RGF_MIN_2.Value,
"Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_Minus_2.Value, "Certificated_Exp") - First(Fields!RSR_MIN_2.Value, "Rev_Code5899") - First(Fields!End_Fund_min2.Value, "End_Fund_Balance")) * (round(Sum(Fields!RGF_MIN_2.Value,
"Revenue") / First(Fields!RGF_MIN_2.Value, "Rev_Code5899"),6))))/(First(Fields!WADA2011_1.Value, "Second_Year_Preceeding_WADA"))) * (first(Fields!WADA2013_1.Value,"Second_Year_Preceeding_WADA"))
IIF((Sum(Fields!RSR_MIN_1.Value, "Revenue") + IIF((Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(Sum(Fields!RGF_MIN_1.Value,
"Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"))< 0, 0.00, (Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(round(Sum(Fields!RGF_MIN_1.Value,
"Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"),6)))) / (First(Fields!WADA2012_1.Value, "Second_Year_Preceeding_WADA")) < 0, 0.00, (Sum(Fields!RSR_MIN_1.Value, "Revenue") + IIF((Sum(Fields!SR_MINUS_1.Value,
"Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(Sum(Fields!RGF_MIN_1.Value, "Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"))<
0, 0.00, (Sum(Fields!SR_MINUS_1.Value, "Certificated_Exp")-first(Fields!RSR_MIN_1.Value,"Rev_Code5899")-first(Fields!End_FundMinus1.Value,"End_Fund_Balance"))*(round(Sum(Fields!RGF_MIN_1.Value, "Revenue")/first(Fields!RGF_MIN_1.value,"Rev_Code5899"),6))))
/ (First(Fields!WADA2012_1.Value, "Second_Year_Preceeding_WADA"))) * (first(Fields!WADA2013_1.Value,"Second_Year_Preceeding_WADA")))
A screen shot of the report:
The value in the bottom box should be: 37,080,118.75
I have tried:
=IIF(ReportItems!Textbox293.Value > ReportItems!Textbox294.Value, ReportItems!Textbox293.Value * ReportItems!Textbox289.Value, ReportItems!Textbox294.Value * ReportItems!Textbox289.Value) and I get a scope error.
I have also tried
=IIF(CDbl(Fields!Textbox293.Value) > CDbl(Fields!Textbox294.Value), CDbl(FieldsTextbox293.Value) * CDbl(Fields!Textbox289.Value), CDbl(Fields!Textbox294.Value) * CDbl(Fields!Textbox289.Value))
I get the same scope error, part of the problem here is that in order to get things to display correctly each row in this section of the report is a different table
Row1 = tablix19
Row2 = tablix20
Row3 = tablix21
Any help here would be greatHello,
In your case, we can try to use Report Variables to resolve the issue. In SSRS, when we have a complex calculation we can create a variable in the report. Variable can be used more than once in a report. Please refer to the following steps:
Open Report Properties dialog box.
Click Variables in the left pane. Then, add specific variable.
(Note: Suppose we have create two variables: textbox293, textbox294)
After that, we can use following expression to calculate the effect:
=IIF(Variables! textbox293.Value > Variables! textbox294.Value,
Variables! textbox293.Value * ReportItems!Textbox289.Value,
Variables! textbox294.Value * ReportItems!Textbox289.Value)
Reference:
Report and Group Variables Collections References
If the issue is persist, please feel free to let me know.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support -
Hi All;
I have a field called createdon
Using this field i need to create the SSRS expression for the table as below
Any help much appreciated
Thanks
Pradnya07use expressions as below
assuming this is to be done in SSRS
Today
=COUNT(IIF(
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
Yesterday
=COUNT(IIF(
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
LastWeek
=COUNT(IIF(
DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
Last fortnight
=COUNT(IIF(
(DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1)
Or (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-2),Fields!YourRequiredField.Value,Nothing))
Last Month
=COUNT(IIF(DateDiff(DateInterval.Month,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Month,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
Year To Date
=COUNT(IIF(DateDiff(DateInterval.Year,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Year,Cdate("01/01/1900"),Now())
And
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) <= DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
SSRS Expression for Conditional Filtering using the "IN" operator
Hello,
I need to filter my dataset based on a parameter:
If Period= 1 then Week must be in (W1, W2, W3), Else Week must be in (W10, W20, W30)
I tried using the "IN" operator but don't know how to create the expression for the "Value" field. I tried the following:
iif(Parameters!Period.Value = 1,
"W1, W2, W3",
"W10, W20, W30")
But it doesn't work.
Expression: Week
Operator: IN
Value: ???
Any help would be highly appreciated!Hi,
Use split function.
See this expression: IIF(Parameters!Period.Value = 1, SPLIT("W1,W2,W3",","), SPLIT("W10,W20,W30",","))
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8da78c9b-7f0c-42f1-a9c4-82f065f317c9/using-the-in-operator-in-ssrs-expressions
Thanks Shiven:) If Answer is Helpful, Please Vote -
Hi,
Can anyone tell me how to use OR in an SSRS expression?
I would like to set the BorderStyle Left (& Right) property to "None" for two rows so I need to
use an OR (6 or 9)
This is what I have so far:
=IIf(RowNumber(nothing)=6,"None","Default")Hi,
Try Below,
=Switch(RowNumber(nothing)=6 ,"None",RowNumber(nothing)=9,"None")
OR
=IIf(RowNumber(nothing)=6 OR RowNumber(nothing)=9,"None","Default")
OR
=IIf(RowNumber(nothing)=6,"NONE",IIf(RowNumber(nothing)=9,"NONE","Default"))
Thanks -
Hi,
I am unable to convert the below ssrs expression to sql query. can you guys help.
-- IIF(Parameters!parameter1.Value Is Nothing,
-- " 3>2 ",
-- "column1 NOT LIKE
-- Replace(IIF(Left(Parameters!parameter1.Value, 1) = "'",
-- Parameters!parameter1.Value,
-- "'" & Replace(Parameters!parameter1.Value, "'", "''") "'"),
Thanks.Thank you for your response Carnegie,
I actually have two stored procedures as below. (columns and joined tables are excluded)
I need to change the dates of @DateFrom and @DateTo parameter, I am passing @DateFrom_FD and @DateTo_LD as well.
CREATE ROCEDURE [dbo].[Test]
(@DateFrom
SMALLDATETIME
, @DateTo
SMALLDATETIME
, @program
VARCHAR(MAX))
AS
DECLARE
@DateFrom_FD
SMALLDATETIME
, @DateTo_LD
SMALLDATETIME
SET @DateFrom_FD = DATEADD(MONTH,DATEDIFF(MONTH,0,@DateFrom),0)
SET @DateTo_LD = DATEADD(DAY,-1,DATEADD(MONTH,DATEDIFF(MONTH,0,@DateTo)+1,0))
SELECT
DimDate.[Year]
, DimDate.[Month]
, DimDate.PK_Date
, CustomerID
FROM DimDate
WHERE DimDate.PK_Date BETWEEN @DateFrom_FD AND @DateTo_LD
Now I am using one of the SP as a main report and the other SP as a subreport.
In order to configure the main report and the subreport, I believe that I need to link them with parameters.
However, in the parameters of subreport properties, the option given are only @DateFrom and @DateTo.
No @DateFrom_FD AND @DateTo_LD
Therefore, I am thinking to use expressions to convert @DateFrom and @DateTo the same way I did in SQL.
I am not sure if this works....but this is the only thing that I could think of.
Thank you,
YJB5151 -
Can we write an IIF statement in Designer??
Hi dears,
Can we write an IIF statement in Designer when we connect to the SAP BI 7.0 InfoCube?
I try to add a new dimension object to my universe design by using IIF statement.
At the below you can find my simple IIF statement.
<EXPRESSION>IIF([0FISCPER3].[LEVEL01].[[40FISCPER3]].[Value]='January',1,0)</EXPRESSION>
Is there anything wrong with syntax or smt??
my Business Objects env is BOXI 3.2
thanks a lot,
OmerHi,
this one includes samples:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0a45246-ce76-2b10-e688-f5c8206203eb
Ingo -
Multiple like statements in a query
Hi,
I wonder if it's possible to have multiple like statements in a query.
suppose instead of
select * from someTable where remarks like '%ab%'
I want to search for many string patterns such as '%edi%' '%odi%' '%di%' '%gf%' '%od%' '%podi%' etc. in one query.
BTW, the table contains many millions of records.
Regards
Crusoe
Edited by: Crusoe on 19-Jan-2009 00:25Crusoe wrote:
This regexp_like function does not work with the development server to which I have rights to create tables etc. I guess it only works in 10g or greater. However i tried a quick test in the production server and it worked. It returned rows where the values between the | characters were found anywhere in the field ( I must learn this regex syntax sometime). Yes, regular expressions are 10g upwards. (You really should have your development server reflect your production server)
There was a thread a while back giving an introduction to regular expressions...
Introduction to regular expressions ... -
Help: How to include logic in multiple CASE statements.
Hello Folks,
I have this Query where am converting from Access to Oracle. Am little confused on how to write multiple CASE statements.Apprecitae your help.
round(Sum(IIf(recovery_flg = 'NONCASH FEE RECEIVED',
IIf(feepaid < FEE, FEE - FEEPAID, FEE),
0)),
2)*(1) you can nest CASE* - CASE in a CASE
CASE WHEN ecovery_flg = 'NONCASH FEE RECEIVED' THEN
CASE WHEN feepaid < FEE THEN ....
END
ENDor
*(2) you can try to rewrite it as one CASE*
CASE WHEN ecovery_flg = 'NONCASH FEE RECEIVED' AND feepaid < FEE THEN...
WHEN ecovery_flg = 'NONCASH FEE RECEIVED' AND feepaid >= FEE THEN ...
END -
Pass function name as parameter in SSRS expression
I have a function (GetColumnFieldName) which returns string datatype
Now I want to use this function in below SSRS expression
=Code.GetDisplay("FirstName",Parameters!SelectedCols.Value,Parameters!DisplayCols.Value)
At the above expression I want to replace "FirstName" with function GetColumnFieldName which returns the same "FirstName".
Please suggest.Hi Jajatibabu,
If I understand correctly, you want to use GetColumnFieldName function which returns a field name to replace the “FirstName” in the expression you post.
If in this scenario, we can directly use Code.GetColumnFieldName(parameters) to replace the “FirstName” like below:
=Code.GetDisplay(Code.GetColumnFieldName(parameters),Parameters!SelectedCols.Value,Parameters!DisplayCols.Value)
Note that we should type the correct parameters in the GetColumnFieldName function.
If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support
Maybe you are looking for
-
How to format my macbook pro and I dont have my lion cd or usb stick?
How to format my macbook pro and I dont have my lion cd or usb stick?
-
I took delivery of a brand new 21.5" iMac a week ago. When it first arrived the internet was fine - then intermittently it started to go slow or just fail to load pages even though I could see it was connected to the router and had full signal streng
-
How to permanently delete email in mail app?
Hi! I am using a 2011 macbook pro and it has been running extremely slow lately. When I started looking into things, it seems that my mail app is saving every email I have ever received, even though I have spent hours deleting them. It seems that the
-
Is there an itunes for me?
I have windows 98 yea it stinks but its all I could aford at the time is there an itunes for me?
-
Go to Next/Previous Marker shortcut bug in Premiere Pro 2014
The keyboard shortcuts Shift+M and Ctrl+Shift+M to move to markers takes you to the next edit point or marker, whichever comes first. I found that using the shortcuts to navigate to the next Marker in the timeline will take you to the next Marker or