Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Expression Error


Expression Error

Author
Message
davdam8
davdam8
SSC-Enthusiastic
SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)

Group: General Forum Members
Points: 180 Visits: 668
Hi geniuses,
I'm having problems with a traffic light indicator expression:

=SWITCH(
ReportItems!Textbox21.Value="1.1.PC" and ReportItems!Textbox23.Value<>"",0,
ReportItems!Textbox21.Value="4.2.PP" or "4.3.PE" or "4.4.S" and ReportItems!Textbox23.Value="",1,
ReportItems!Textbox21.Value="1.1.PC" or "1.2.PV" or "1.3.PNV",2
)

The error: ...an error: Input string was not in a correct format.
But if I only use:

=SWITCH(
ReportItems!Textbox21.Value="1.1.PC" and ReportItems!Textbox23.Value<>"",0,1
)
It works fine.

???
Thanks
Regrdas
H4K
H4K
SSC-Enthusiastic
SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)

Group: General Forum Members
Points: 135 Visits: 567

ReportItems!Textbox21.Value="4.2.PP" or "4.3.PE" or "4.4.S" and ReportItems!Textbox23.Value="",1


You got to change the above line to :

(ReportItems!Textbox21.Value="4.2.PP" or ReportItems!Textbox21.Value="4.3.PE" or ReportItems!Textbox21.Value="4.4.S") and ReportItems!Textbox23.Value="",1

BI Developer
SSRS, SSIS, SSAS, IBM Cognos, IBM Infosphere Cubing services, Crystal reports, IBM DB2, SQL Server, T-SQL
Please visit... ApplyBI
davdam8
davdam8
SSC-Enthusiastic
SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)

Group: General Forum Members
Points: 180 Visits: 668
Hi I'm getting a warning error while rendering my report, it says that 'Input string was not in a correct format.'

=SWITCH(
ReportItems!Textbox70.Value="2.2.PA" and IsNothing(Lookup(Fields!ProjectGUID.Value, Fields!ProjectUID.Value, Fields!PBSD.Value, "DataSet3")),1,
ReportItems!Textbox70.Value="2.2.PA" and Lookup(Fields!ProjectGUID.Value, FIelds!ProjectUID.Value, Fields!PBSD.Value, "DataSet3")="",2,
ReportItems!Textbox70.Value="1.1.PC" or "1.2.PV" or "2.1.PS",3)

It is for sure because, when I want to to know if Fields!PBSD.Value is = "" or not.
Any solution?

Thanks
Regards
H4K
H4K
SSC-Enthusiastic
SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)

Group: General Forum Members
Points: 135 Visits: 567
PLEASE REFER TO MY PREVIOUS POST...

BI Developer
SSRS, SSIS, SSAS, IBM Cognos, IBM Infosphere Cubing services, Crystal reports, IBM DB2, SQL Server, T-SQL
Please visit... ApplyBI
davdam8
davdam8
SSC-Enthusiastic
SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)

Group: General Forum Members
Points: 180 Visits: 668
Anyway, it gives me the same error.

Thanks!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search