You are using a repeating field. Usually, there are better options for structuring your data that do not require using repeating fields.
But working with what you currently have, define a calculation field as:
Substitute ( List ( Sub Kategori ) ; ¶ ; ", " )
And then put this caculation field on your layout in place of the merge text. List will drop out any blank repetitions and substitute puts a comma and space in place of the returns that list uses to separate the values extracted from the repeating field.
Thanks a lot. That really made a difference.
With regards to your comment about using repeting fields.
What structiring method would you use ?
Thanks a bunch
98% of the time, you can replace a repeating field with a related table and use a portal, or series of portals to display and work with the data in the related table. This resolves a number of potential problems that complicate your solution when you use a repeating field.
- Repeating fields come with a built in upper limit. If you fail to allow for enough repetitions, you have to update the field's definition and any layouts where it is used. A related table has no upper limits and if more records are needed, adding them is a data entry task not a database developer task. Often, there is no need to modify your layout designs to accomodate the increase.
- Many reporting tasks are difficult to impossible to do when the data is stored in repetitions of a repeating field. Say the repetitions store the items purchased on an invoice. If you want to create a sales report spanning multiple invoices that sums up or counts the sales of individual items so that you have a total for each items sold, you will find that either you must export the data into a different table with one record for each repetition--and if you have to do that, might as well use a table with that structure in the first place.
- Trying to set up relationships with pairs of repeating fields such that entering a value in repetition 1 of field 1 looks up a value in repetition 1 of field 2 can't be done--you'd have to script it. With a related table, it's quite simple to do with a single relationship between tables.