Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do I use an array?

Status
Not open for further replies.

CPK6104

IS-IT--Management
Dec 19, 2007
57
US
I have no experience creating an array. I'd love to see some simple examples of array formulas.

I think I may have a situation were creating an array would be useful (please tell me if I'm wrong).

I have a field in a record (Application Name) that has a corresponding field (Entry Complete) that will either have the value of 0 or 1. There could be one record or many, and each will have the Entry Complete field.

I'd like a formula that outputs a list of Application Names where the Entry Complete field is = 0

Any help is appreciated. Thanks in advance.
 
It doesn't look like you need arrays. Please show a little sample data for these two fields, and then show the results you would expect to see. I'm wondering what you want to happen if there can be both a 0 and a 1 in different records for the same application (if this is possible).

-LB
 
Thanks lbass.

Example individual records would look like this:

1. application_name = APP1 and entry_complete = 0
2. application_name = APP2 and entry_complete = 0
3. application_name = APP3 and entry_complete = 0
4. application_name = APP4 and entry_complete = 1
5. application_name = APP5 and entry_complete = 1

formula results would be:
APP1, APP2, APP3



 
I'm assuming that that is NOT how the records display if the fields are placed in the detail section. Can you verify that records would look like this:

application_name entry_complete
APP1 0
APP2 0

//etc.?

Is the horizontal comma-delimited list what you are looking for? Is this per some group?

Why not eliminate non-zero records in your record selection formula?

-LB
 
You are correct that in the details section the records would appear in columns:

application_name entry_complete
APP1 0
APP2 0

The delimited field would be in a group. The group also contains a table that displays all records regardless of entry_complete. Normally, I would drop entry_complete in the table but I'm out of real estate.

 
I don't really know what you mean by your last sentence. Anyway, you can create three formulas like this:

//{@reset} for the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} for the detail section:
whileprintingrecords;
stringvar x;
if not({table.application_name} in x) then
x := x + {table.application_name} + ", ";

//{@display for the group footer:
whileprintingrecords;
stringvar x;
if len(x) > 2 then
left(x,len(x)-2)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top