Solved

Script Error Message

Posted on 2014-04-08
2
171 Views
Last Modified: 2014-04-09
Hi there,

I have the following formula to group records in my report;

if {GfApls_1ApApP_1.GfApls_1ApApP_1_Description} in ["Bank 13-14", "Food Bank 12-13",
"Bank2 13-14"]
then {GfApls_1ApApP_1.GfApls_1ApApP_1_Package}
else
Split({GfApls_1Ap.GfApls_1Ap_Description},"_")[2]

This worked before but now that I have added the first criteria I receive the error message, "A Script must be between 1 and the size of the array" -

Does anyone have an idea of what is happening here?  Please let me know if anything is unclear.
Thanks very much!
CS
0
Comment
Question by:rporter45
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 39987804
Apparently some values don't have a _ in the string.

Try

if {GfApls_1ApApP_1.GfApls_1ApApP_1_Description} in ["Bank 13-14", "Food Bank 12-13", "Bank2 13-14"]
then {GfApls_1ApApP_1.GfApls_1ApApP_1_Package}
else if Instr({GfApls_1Ap.GfApls_1Ap_Description},"_") > 1 then
     Split({GfApls_1Ap.GfApls_1Ap_Description},"_")[2]
Else
    {GfApls_1Ap.GfApls_1Ap_Description}

Open in new window


mlmcc
0
 

Author Closing Comment

by:rporter45
ID: 39988565
That worked perfectly! Thank you very much, I never considered that would have been the issue.

Have a great day,

CS
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now