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!
~george
Hi 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
Similar Messages
-
Second max/min in ssrs report builder expression
I need to do conditional formatting on second max/min in an ssrs report builder table.
Can i get it in an expression ?Hi AshishSinghal84,
Based on my understanding, you want to perform conditional formatting on the second maximum or minimum value in Report Builder.
In Reporting Services, there is no built-in function which can return second maximum value. So in this scenario, we can’t directly use expression to perform conditional formatting. However, we can get the second maximum or minimum on query level. Then insert
a column into tablix and use Lookup function to return a specific value so that we can do the conditional formatting based on this value. As we test in our local environment, to perform conditional formatting such as change the color for second maximum value
in Report Builder, we can follow the steps below:
1.Add Dataset2, apply the query below:
select max(sales)
From test
where sales < (select max(sales)
from test)
2.On report, add an Expression “=lookup(Fields!sales.Value,Fields!secondmax.Value,1,"DataSet2")”, looks like below:
3.Click [month], Properties appears on the right panel. Find Color under Font tab, click Expression, then type “=IIF(ReportItems!Textbox6.Value=1,"red","black")”.
4.Right click the third column, choose Column Visibility\Hide, click Ok.
5.Final result looks like below:
To perform conditional formatting on second minimum value, the steps are a little different from getting second maximum value. You should change the query at first step, then apply the query below:
select min(sales)
From test
where sales > (select min(sales)
from test)
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu -
Display issue with HTML formatted text in report builder
I am using the FCKeditor in my application to allow endusers
the ability to create formated text on reports. We curently are
experiencing 2 issues: 1. If you copy and paste from MS Word
2003/2007 it will not display the text correclty in the report; 2.
If you use the FCKeditor toolbar to insert bullets or a numeric
list it will not align the text correctly on the report. We are
using Coldfusion 8 with Hotfix 1 and Coldfusion Report Builder's
lastest build release.
Has one experiences this same issue with HTML fields not
printing correctly using the Report Builder? What other HTML
editors besides FCKeditor might we use?
Thanks,
Dan VanWierenCan you tell me how to use </td> for each values
Give me your example report - using before or after report
Thanks
MT
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by fdenis:
Hi Gavin,
If I understand well, your HTML tags are coded directly in your fields in the database, right? Because if it was not the case, you could have use a format trigger checking for which destination you're generating your report...
if UPPER(:DESFORMAT) = 'HTML' or
UPPER(:DESFORMAT) = 'HTMLCSS'
then
-- insert your HTML code in the value
-- of your field. something like...
newValue := '<B>' | | :YOUR_FIELD | | '</B>
srw.set_field_char( 0, newValue );
else
-- when generating to other format,
-- you'd have to add the formatting as
-- you want.
end if
return( true );
Of course, if it's not acceptable to remove the HTML tag from your database fields, you could develop a procedure that would translate your HTML tags to the good formatting (eurk... ;-)
Good luck... :-)
Frederic
<HR></BLOCKQUOTE>
null -
I have a simple SharePoint list with a multiple line column that has append changes enabled. I am doing a report with Report Builder 3.0 and I want to show all values of the field the same way you achieve it through a DVWP using:<SharePoint:AppendOnlyHistory
FieldName="Comments" runat="server"
ControlMode="Display" ItemId="{@ID}"/>
Any suggestions to show all the appended values?Hi,
I am trying to involve someone familiar with this topic to further look at this issue.
Regards,
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Rebecca Tu
TechNet Community Support -
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 -
SQL Server 2012 - applying SP2 breaks SSRS Report Builder
Hi,
Had SQL 2012 (was 11.00.2845) and SSRS configured and working.
Applied SQL 2012 SP2 (server now at version 11.0.5058.0 (X64).
But when I goto the typical "http://server/ReportS_INST1 - reports still work ok, but clicking on Report Builder looks like it starts the download and then errors.
The error is "Application validation did not succeed. Unable to continue.".
Clicking on Details gets the message below. I understand it thinks it has a version mismatch, but anyone know what the resolution should be?
Thanks
Matt
--------------------error details
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime
: 4.0.30319.18444
System.Deployment.dll
: 4.0.30319.18408 built by: FX451RTMGREL
clr.dll : 4.0.30319.18444 built by: FX451RTMGDR
dfdll.dll : 4.0.30319.18408 built by: FX451RTMGREL
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url
: http://server/ReportServer_INST1/ReportBuilder/ReportBuilder_3_0_0_0.application
Server
: Microsoft-HTTPAPI/2.0
X-AspNet-Version: 2.0.50727
Application url
: http://server/ReportServer_INST1/ReportBuilder/RptBuilder_3/MSReportBuilder.exe.manifest
Server
: Microsoft-HTTPAPI/2.0
X-AspNet-Version: 2.0.50727
IDENTITIES
Deployment Identity
: ReportBuilder_3_0_0_0.application, Version=11.0.5058.0, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=x86
Application Identity
: MSReportBuilder.exe, Version=11.0.5058.0, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=x86, type=win32
APPLICATION SUMMARY
* Online only application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://server/ReportServer_INST1/ReportBuilder/ReportBuilder_3_0_0_0.application resulted in exception. Following failure messages were detected:
+ File, Microsoft.Data.ConnectionUI.dll, has a different computed hash than specified in manifest.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [8/11/2014 3:00:48 PM] : Activation of http://server/ReportServer_INST1/ReportBuilder/ReportBuilder_3_0_0_0.application has started.
* [8/11/2014 3:00:48 PM] : Processing of deployment manifest has successfully completed.
* [8/11/2014 3:00:48 PM] : Installation of the application has started.
* [8/11/2014 3:00:49 PM] : Processing of application manifest has successfully completed.
* [8/11/2014 3:00:49 PM] : Found compatible runtime version 4.0.30319.
* [8/11/2014 3:00:49 PM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [8/11/2014 3:00:55 PM] System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, Microsoft.Data.ConnectionUI.dll, has a different computed hash than specified in manifest.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
at System.Deployment.Application.ComponentVerifier.VerifyComponents()
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification
notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String&
errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
--------------------error details endHello,
It seems to me somebody applied SP2 for SQL Server 2012 on an instance that has installed SQL Server 2012 SP1 CTP 4. CTP4 is not
the final version of SP1.
http://sqlserverbuilds.blogspot.com/
My suggestion is to uninstall SP2 (using Control Panel), download and apply SP1 from the following link, and then apply SP2 again.
http://www.microsoft.com/en-us/download/details.aspx?id=35575
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
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 -
SSRS- report builder showing recent sites and server as blank
Hi All,
A client of ours when executes Report builder is not able to see Report models as report builder just gets open but do not create connection to server.
We have done the following settings for same:
Used both name and IP of system and added the same to Trusted Sites in IE settings
Also we have used port number along with URL for report builder.
We have given all rites to user on reporting services (SQL)
But it is still not showing report models.
Kindly help us. It is very urgent.
Thanks in advance
-Regards
KumudHi Kumud,
According to your description, your client can't see the created report models in Report Builder. Right?
In this scenario, the reason why the client can't see the report models because he doen't connect to report server. Please click the
Connect at the left bottom of Report Builder and type the report server url manually to reconnect the report server.
If the connection is failed, please check if there any process on client side which occupies the port for report server URL. Here are two articles for your reference to do troubleshooting.
Report Builder 3.0 error : Connection Failed. Unable to connect to the server that is specified in the URL
Connecting to Report Server
Since the Semantic modeling language (SMDL) report models are deprecated. Although you can you continue to use existing report models as data sources in SQL Server 2012 or later version Reporting Services reports you should consider updating your reports
to remove their dependency on report models.
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
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
jerYou 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)) -
Trouble with city, state in Mysql Query
Hello,
I am having trouble with a query I am trying to setup. Basically, I want the user to type in their city. Then I want the system to ask them which city,state combo is theirs. So if they enter "Washington" the system will return:
Select your city/state:
Washington, NJ
Washington, PA
Washington, DE
City and state are stored as two fields in my mysql DB. I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields. So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
So anyone have any ideas or code samples they have used to do something like this?
Thanks in advance,
Markdavella wrote:
City and state are stored as two fields in my mysql DB. I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields. So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
DISTINCT works the same way for single field or multiple fields. It returns all distinct combinations of the values in the columns you have listed.
SELECT DISTINCT City, State
FROM Table
WHERE City = 'Washington'
(Data) City, State
Washington, NJ
Washington, PA
Washington, NJ
Washington, DE
Washington, NJ
Washington, PA
So for your two columns it would distinct combinations of the "City" and "State" values. But why are there multiple "Washington, NJ" records? Are they actually different cities or duplicate records?
(Results)
Washington, NJ
Washington, PA
Washington, DE -
How to use LIKE function with a parameter in Oracle REPORT builder??
how could i use parameter inside a LIKE function in Oracle reports builder?
it works in SQL plus, but not in report builder!!
Example:
select code,desc from item_master where desc
like '%&give_desc%'; ---works in SQL
like '%:give_desc%' ---doesn't work in report builder!!Hi Renil,
You will need to use the wildcard character (%) and the concatenation character (||) to join to your user parameter.
i.e. like '%'||:give_desc||'%'
Regards,
John -
Trouble with multi state object
How do i build a graphic step by step with the previous state still showing?
You add the previous state to the next one and keep building it that way.
Bob -
Hello all that can help,
i am programming in Ready to Program to connect to a VideoShop database using SQL statements.
I am having trouble when using single and double inverted commas. eg vs.updateRentTable ("DELETE FROM RentTable WHERE CustId=);
but instead of specifiying the CustId i want to make it a variable id so that i can delete any name i want according to their ID.
also i am wondering if it is possible to write data from a database into a text file? is it possible to use Printwriter?
Looking forward to your help,
Manuking16Hi Manuking_16,
Your question should be posted on a sql forum, not on a JDBC forum. Anyway. Just looking for answers, right?
1) If your datatype is INT, you do not use either quotes " or single quotes in your SQL statement
DELETE FROM RentTable WHERE CustId= 12345.
To build the SQL String in JAVA just write:
{code}String sqlStatement = "DELETE FROM RentTable WHERE CustId = " + custID; // custID will be casted to String.{code}
2) Use preparedStatement
{code}PreparedStatement pStm = conn.prepareStatement(�DELETE FROM RentTable WHERE CustId = ?");
pStm.setInt(1, customerID);
int numberOfDeletedLines = pStm.execute();3) If you want to enter the real name to do the deletion
DELETE FROM RentTable WHERE CustId IN (select custID FROM Customer WHERE name = "joe bob johnson")
To build the SQL String in JAVA just write: String sqlStatement = "DELETE FROM RentTable WHERE CustId IN (select custID FROM Customer WHERE name = '" + sCustomerName + "' )"; // just copy & pasteHope I got your question right. -
SSRS Report Builder 3.0 - Pie Chart
Hi,
I have Pie chart that displays Number of items by Country,
My data set is pulling the correct values.
The 3D effect is true for the pie chart and the Series Labels are set to diplay out of the Slice.
I used the collected style to be SingleSlice and not using percentages but just the values less than or = 5 to be collected to other countries slice.
for labels format I am using a column value from the query where I Concatenate the Value and Name of the country as string as I am not showing the legend on the chart for more space
All the values are showing up right except for one value for one slice which is added extra numbers at the beginning of the number part of the string.
For Example , if for USA there are 320 items it should should show up as USA - 320 as that is the value that the query bring and I double checked that. But that value dipslays USA - 12320 for some reason and this is happening only with one
label.
I might be missing somethign silly but if someone can save my time and help me it would be appreciated.
Please let me know if you have any questions.
Thanks,
ChaitanyaHi Chaitanya,
Sorry for the delay.
I am unable to reproduce the issue in my test environment. The issue seems rather odd. Here, I suggest that you create a new report and design the Pie Chart from scratch, and then check the issue again.
If the issue persists, please post the expression of the label data as well as the CustomAttributes settings of the target series of the Pie Chart.
Regards,
Mike Yin
TechNet Community Support
Maybe you are looking for
-
Unable to install SAP B1 on Windows server 2008 R2
Hi I am unable to install the SAP Business one 2007 B PL00 on Windows server 2008 R2. Environment is set as following : 1. SQL SERVER 2008 Installed on Server A 2. SAP B1 to be installed on Server B 3 Both servers are in domain 4.Firewall is off 5. O
-
Trying to access methods from a .class file by creating instance of class
Hey all, I'm hoping you can help. I've been given a file "Input.class" with methods such as readInt(), readString(), etc. I have tried creating instances of this class to make use of it, but I receive the error "cannot find symbol : class Input". If
-
Mac book air Bluetooth internet connection
Hi, I am trying to connect my mobile phone which is on vodafone in the UK through a bluetooth dial up connection on my mac book air. The phone connects to the mac, but when i press connect bluetooth DUN it tries to connect but fails to establish a co
-
Hi All: I am trying to create a new application in WebDynPro ABAP But i find no window to drag my newly created view into it. Please suggest any solution Regards: Arun
-
How can I learn developing Mobile Andriod Applications in Dreamweaver CS6 ?
How can I learn developing Mobile Andriod Applications in Dreamweaver CS6 ?