help with an expression

zz 21 Reputation points
2022-01-31T17:49:27.96+00:00

Hi all

Good afternoon

I have an excel formula and i need help converting it to an ssrs expression any help is greatly appreciated

=IFERROR(IF(C26="PART","",IF(ISNUMBER(IF((LEN(G26)-LEN(SUBSTITUTE(G26,"x","")))=1,MID(G26,FIND("|",SUBSTITUTE(G26,"x","|"))-1,1)+0,"")),(J26/F26)/H26,J26/H26)),"")

Lets just assume that the field name in ssrs for C26 is called "A" G26 "B" J26 "C" F26 "D", H26 "E"

Thanks

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,850 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Joyzhao-MSFT 15,571 Reputation points
    2022-02-01T01:54:00.247+00:00

    Hi @zz ,
    The linest excel function is just linear regression. It's (still) not available in sql server.

    For the Decision Functions
    Commonly used conditional functions in SSRS are IIF, Switch and Choose.

    =IIf ( <condition> , <return value if true> , <return value if flase> )  
    =Switch(<condition>, <return value if true>, <next condition>, <return value if true>, ...)  
    

    For the length issue:

    = LEN(Fields!YourField.Value)  
    

    or

    = Fields!YourField.Value.Length  
    

    If your field is not a string, try converting first by using the Cstr function:

    = LEN( Cstr(Fields!YourField.Value) )  
    = Cstr(Fields!YourField.Value).Length  
    

    For more information. please refer to: Expression examples in paginated reports (Report Builder).
    The use of functions usually depends on your report design and data. So please share screenshots of your designs if possible. You could also try the functions I provided above.
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments