Jump to content

Count repeating field repetitions with data


This topic is 2253 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi 

I am designing a very simple proposal with stages of the project in text which is held in a repeating field with 50 repetitions.  Next to each I want to show a number but the number list should correspond to the number of repetitions that contain data

Here is an example of what I am looking for

The fields are LineItemsCount and LineItemsDescription, both are repeating fields with 50 repetitions

This is how it should print

Item    Description

1         first item

2         second item

3          third item

The description part works perfectly and only shows the repetitions were there is data (and as this has to be printed, the size if automatically adjusted to print on the required number of pages).  

However to create the number list automatically and how to check whether there is data in the description and only create a number for the repetitions with data.  

 

Link to comment
Share on other sites

I suggest you use a related table instead of repeating fields. A lot of things will become easier, not just the numbering (which would be trivial using the record number symbol, or a summary field counting the records).

Link to comment
Share on other sites

It's probably a better idea to use a related table instead of a repeating field.  It really depends on how far you might want to extend things later...   Kept simple, repeating fields are OK for this type of thing, however you might find yourself hitting limitations later.  

Anyway, here's a method which gives sequential Item numbers which skip any empty entries...

 

Description  is your Description 'Text' field

 

 

Repetition  is an additional repeating Calculation field of type 'Number' defined as:

 

If ( not IsEmpty ( Description ) ; Get(CalculationRepetitionNumber))

 

 

Item  is another repeating Calculation field of type 'Number' defined as:

 

Let ( [

theList = List (Repetition) ;

thePosition = Position ( theList ; Repetition ; 1 ; 1 ) ;

shortList = Left ( theList ; thePosition ) ] ;

 

 

If ( Repetition > 0 ; ValueCount (shortList )))

 

 

 

Picture.png

Edited by Ralph Learmont
Link to comment
Share on other sites

Thanks for the fast reply :-)

Ok I can set this up and as related table as the fields were already part of the quote /item items,  however the final output will be printed and sent to the customer.  The reason I chose a repeating field is that (I thought) this would be easier to format as a merge field and have the document automatically reduce in size depending on the number of items in the quote.  

A appreciate that this is going onto another topic however

The format of the printed report could be half a page or 3 pages depending on the number of line items.  The format of the final printed page is

Part 1 - customer details, date, quote number etc.

Part 2 - Repeating field which could be between 1 - 50 lines

Part 3 - final price.

I want this to print with with the final price directly underneath the last line item

If I am using a related table,  don't I need to have a portal of defined size to accommodate the maximum size of the document (i.e 50 lines)?

Is it possible to get a portal to "shrink" when printed and then have the pricing information directly underneath Part 2 regardless of the number of line items in the portal?

Thanks

 

  

Link to comment
Share on other sites

1 hour ago, Eco Heat Renewables said:

If I am using a related table,  don't I need to have a portal of defined size to accommodate the maximum size of the document (i.e 50 lines)?

No. You would print from the child table, and use either grand summary or sub-summary parts for the parent details and summary values.

Link to comment
Share on other sites

This topic is 2253 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.