Jump to content

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

Recommended Posts

Hi all

I'm trying to display a list inside one field on one row that contains the field values of the related child records. Using UniqueValues() I'm able to filter that list down to remove duplicates, of which there are many for some records. The following calculation works as expected, however UniqueValues() seems to be counting an extra blank record at the end and I'm struggling to find how this is happening.

I'm using Substitute() to replace carriage returns with a comma to keep the data on one line. If left as a list there is a blank row at the bottom of the field. When subbing returns for commas the last returned item is followed by a comma.  See below:

Substitute ( UniqueValues ( List ( Product Assets::ownership ) ) ; "¶" ; ", " )

 

Record One
Record Two
Record Three

 

Record One, Record Two, Record Three,

Perhaps there's another way to achieve this, and/or I'm missing something simple. Suggestions appreciated!

 

Edit: Ok, after further reading I realize this is normal behavior.

Edited by madman411
Link to comment
Share on other sites

5 minutes ago, comment said:

All xValues functions include a trailing carriage return in their result. In your example, you could do:


Substitute ( UniqueValues ( List ( ChildTable::Valuefield ) ) & ¶ ; [ "¶¶" ; "" ] ; [ ¶ ; ", " ] )

 

Thanks comment - of course this worked. You're a star. Can you explain what is happening in this function so I can better understand? Cheers

Link to comment
Share on other sites

First we append another CR to the result of UniqueValues(), so we get:

"Record One¶Record Two¶Record Three¶¶"

Now we substitute (1) a pair of CRs with nothing:

"Record One¶Record Two¶Record Three"

and (2) a CR with comma and space:

"Record One, Record Two, Record Three"

 

  • Like 1
Link to comment
Share on other sites

This topic is 1044 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
×
×
  • Create New...

Important Information

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