merging value lists?

8 messages Options
Embed this post
Permalink
Colm Osiris-3

merging value lists?

Reply Threaded More More options
Print post
Permalink
Hi Experts

Is it possible to merge value lists?

I have two different tables (Suppliers and HomeEconomists), but the  
client wants a value list in a third table containing entries from both.

Short of creating a temporary table, combining the first two, is there  
any way I can get data from both tables into one value list?

Otherwise I'm faced with either making a new table, or merging the  
actual Suppliers and HomeEconomists tables. Quite a lot of current  
programming is based on them being two distinct tables, so either of  
these methods will entail a fair bit of work.

TIA

Colm
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Stephen Wonfor

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
Colm

A QAD test suggests that this is a possibility...

Set Variable [ $One; Value:ValueListItems ( Get ( FileName ) ;  
"List1") ]
Set Variable [ $Two; Value:ValueListItems ( Get ( FileName ) ;  
"List2") ]
Set Variable [ $Three; Value:$One & "¶" & $Two ]
Show Custom Dialog [ Message: $Three; Buttons: “OK” ]
Set Field [ test1::_stList; $Three ]
Set Variable [ $Four; Value:ValueListItems ( Get (FileName) ;  
"List3" ) ]
Show Custom Dialog [ Message: $Four; Buttons: “OK” ]

The dialog lists one list (alphabetical) above the other  
(alphabetical).  Then the next gets a sorted list from the disposable  
field "_stList".

Seems to work if that is what you meant...

Stephen

............
"Photons have mass ?!? I didn't even know they were Catholic..."

On Jun 22, 2009, at 7:35 AM, Colm Osiris wrote:

> Hi Experts
>
> Is it possible to merge value lists?
>
> I have two different tables (Suppliers and HomeEconomists), but the  
> client wants a value list in a third table containing entries from  
> both.
>
> Short of creating a temporary table, combining the first two, is  
> there any way I can get data from both tables into one value list?
>
> Otherwise I'm faced with either making a new table, or merging the  
> actual Suppliers and HomeEconomists tables. Quite a lot of current  
> programming is based on them being two distinct tables, so either of  
> these methods will entail a fair bit of work.
>
> TIA
>
> Colm
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Stephen Wonfor

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
Colm

I should add that "List3" is a self-populating list based on _stList  
contents.  Works fine with all values in just one field.

Stephen
...................
"I can't say I was ever lost, but I was bewildered once for three  
days" -- Daniel Boone (1734-1820)

On Jun 22, 2009, at 8:06 AM, Stephen Wonfor wrote:

> Colm
>
> A QAD test suggests that this is a possibility...
>
> Set Variable [ $One; Value:ValueListItems ( Get ( FileName ) ;  
> "List1") ]
> Set Variable [ $Two; Value:ValueListItems ( Get ( FileName ) ;  
> "List2") ]
> Set Variable [ $Three; Value:$One & "¶" & $Two ]
> Show Custom Dialog [ Message: $Three; Buttons: “OK” ]
> Set Field [ test1::_stList; $Three ]
> Set Variable [ $Four; Value:ValueListItems ( Get (FileName) ;  
> "List3" ) ]
> Show Custom Dialog [ Message: $Four; Buttons: “OK” ]
>
> The dialog lists one list (alphabetical) above the other  
> (alphabetical).  Then the next gets a sorted list from the  
> disposable field "_stList".
>
> Seems to work if that is what you meant...
>
> Stephen
>
> ............
> "Photons have mass ?!? I didn't even know they were Catholic..."
>
> On Jun 22, 2009, at 7:35 AM, Colm Osiris wrote:
>
>> Hi Experts
>>
>> Is it possible to merge value lists?
>>
>> I have two different tables (Suppliers and HomeEconomists), but the  
>> client wants a value list in a third table containing entries from  
>> both.
>>
>> Short of creating a temporary table, combining the first two, is  
>> there any way I can get data from both tables into one value list?
>>
>> Otherwise I'm faced with either making a new table, or merging the  
>> actual Suppliers and HomeEconomists tables. Quite a lot of current  
>> programming is based on them being two distinct tables, so either  
>> of these methods will entail a fair bit of work.
>>
>> TIA
>>
>> Colm
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Stephen Wonfor
Thanks very much for those, Stephen. It looks like a very useful  
technique.

Unfortunately, I should've mentioned that this value list needs to be  
accessible via a pop-up menu. :-(

Colm
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Stephen Wonfor

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
Colm

My test file has a popup menu based on the results.  I took the values  
from $Three, wrote that into the disposable field _stList (so it has a  
return delimited set of values in it) and then based a list off of  
_stList.   It even does the alphabetizing as well.

Stephen

----------

"One thing binds all gatherers of trivia. They do not see all those  
various and seemingly unrelated facts and figures as trivial or  
unrelated. They see them as clues to a mystery, or pieces in a vast  
puzzle that once enough of them are assembled will reveal the hidden  
and interconnected nature of the universe, just as isolated islands in  
a chain are really the exposed mountain tops of an undersea range  
separated by our own inability to penetrate beyond the surface." -  
(anon)

On Jun 22, 2009, at 8:36 AM, Colm Osiris wrote:

> Thanks very much for those, Stephen. It looks like a very useful  
> technique.
>
> Unfortunately, I should've mentioned that this value list needs to  
> be accessible via a pop-up menu. :-(
>
> Colm
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
Thanks very much Stephen, I'll take a look at it.

Colm
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Chaim Bacon-2

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Colm Osiris-3
Hi Colm,

If you want something a little more dynamic, you could also look at a  
custom function like this one from Brian Dunning's excellent website.

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

Kind regards,

Chaim Bacon
Director
Productive IT (UK) Ltd.

FileMaker 7 Certified
FileMaker 8 Certified

****************************************************************
*  Business Process Engineering
*  Custom software development
*  Systems integration
*  Productivity enhancement
*
*  email: [hidden email]
*  www.productiveit.co.uk
*
****************************************************************
*  75 The Campions, Borehamwood, Hertfordshire, WD6 5QG, England
*  Tel: 08458 62 52 52
*  Mobile: 07956 655 150
****************************************************************
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: merging value lists?

Reply Threaded More More options
Print post
Permalink
Thanks to Stephen and Chaim for the advice.

As it turns out (!) it was nowhere as simple as I thought. What is  
being selected through the pop-up menu is not data field but a key  
field (using the very useful 'Also display values from second field'  
and 'Show values only from second field'). This is to follow my rule  
that the only foreign data that should be in any table are foreign keys.

So to cut a long story short, I had to create a new table, and update  
it every time the other two are changed. As it was, I had to slightly  
compromise my rule, but at least it's a field which is set by a  
script, not a calculation, so I can use it in a relationship. And I  
had to change the primary keys in the original two tables, so that one  
is always even, and the other is always odd. That way I could easily  
tell which table any record in the third table would relate to.

I don't know if I've explained this very well, but I spent a day and a  
half trying four different ways of doing what I needed without having  
to create a new table, and finally I gave up, and went for the  
compromise which involved the smallest breaking of my rules. This is  
the first time in the whole solution I've had to break one of my  
rules, which considering it has 49 base tables and 419 table  
occurrences (so far), isn't bad going. I hope!

Colm
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au