Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I am trying to concatenate unique child record for parent record...i was able to concatenate all child records for a given parent record using Substitute ( List ( child::record ) ; ¶ ; ", " )....but cannot figure out how do i remove the duplicate values 

 

 

for example: Car company has multiple models..but each model can only car, mid-suv, large-suv, truck etc.....now when i am populating information for Ford, i only want to have car, mid-suv and truck once not for all the model...and same for Hyundai 

 

can someone please guide about how to remove the extra child record during list

 

thanks

 

Posted

Using your example: do you have a Types table? As in …

 

Make (Manufacturer) --< Models >-- Types

 

This lets you List () the types from the Types table, which will return a list with unique matching types.

Posted

I am trying to concatenate unique child record for parent record...i was able to concatenate all child records for a given parent record using Substitute ( List ( child::record ) ; ¶ ; ", " )....but cannot figure out how do i remove the duplicate values 

 

 

for example: Car company has multiple models..but each model can only car, mid-suv, large-suv, truck etc.....now when i am populating information for Ford, i only want to have car, mid-suv and truck once not for all the model...and same for Hyundai 

 

can someone please guide about how to remove the extra child record during list

 

thanks

 

http://www.briandunning.com/cf/1373

http://www.briandunning.com/cf/596

 

 

They are 2 of many custom functions that perform removwl of duplicate values from a list

Posted

If you have FM Advanced you could use a recursive custom function, like this:https://www.briandunning.com/cf/596

 

 

 

UniqueValues ( valueList )

Let([

//test val
value = GetValue(valueList; 1);
valCountFilter = ValueCount(FilterValues(valueList; value));
valCount = ValueCount(valueList);
//new param
newList = RightValues( valueList; valCount - 1);

thisResult = Case(valCountFilter = 1 ; value & Case(valCount >1 ; "¶" ));
//result
result =  thisResult & Case(valCount > 0 ; UniqueValues( newList ) )

] ;


result

)

Posted
when i am populating information for Ford, i only want to have car, mid-suv and truck once

 

If you do not have a table of Types, you can (if you haven't already) define a value list "Types" using values from the field "Models::Type". Then use a calculation =

 Substitute ( FilterValues ( ValueListItems ( Get (FileName) ; "Types" ) ; List ( Models::Type ) ) ; ¶ ; ", " )

This doesn't require the Advanced version to install - and it will be much faster than a recursive custom function to boot.

 

 

---

You could also define the value list to show only related values, starting from Manufacturers, and eliminate the need for filtering - but you'd probably want to use the value list in order to populate the Type field in Models, so that would be less convenient.

  • Like 1
Posted

@Kris/David:   I cannot use UniqueValues as I have FMP advanced but not Advanced Pro...not sure how i add custom functions in FMP advanced....please let me know if there is other way around 

 

 

@consultant: i tried your logic...but for some reason it is not working....not sure why..do i need to create a filed 'Types' with valuelist from MOdels:type before i used the calculation......

 

Thank you for all your help !!

Posted

Do you think it's a good one?

 

Note also that OP's profile shows 13 (not Advanced), so a recursive custom function is not the best recommendation for them.

Comment :  I did not notice the 13 not advanced caveat. My mistake.

Next time I ref a CF in a post ill put in a disclaimer. :laugh2:

 

OP: Comments solution is deffinately the best for your implementation.

This topic is 3903 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.