Thank you both I will give this a try later today.

-----Original Message-----
From: ProfoxTech <[email protected]> On Behalf Of Gianni Turri
Sent: 19 September 2024 12:58
To: [email protected]
Subject: Re: Matrix

Hi Chris,

like pointed out by Bill, use Cross Join.

In VFP SQL, a cross join is a join without any criteria.

Put the Product code in a table or cursor, do the same for Option 1 and Option 
2 and Option ...

Then do the following query:

select ;
        Product.Code, ;
        Option_1.Option as Option_1, ;
        Option_2.Option as Option_2 ;
        from Product, Option_1, Option_2 ;
        order by 1, 2, 3 ;
        into cursor Combinations

HTH,
Gianni

On Wed, 18 Sep 2024 12:54:50 +0000, Chris Davis <[email protected]> wrote:

Before I start does anyone have any useful pointers in writing some code to 
generate a list of all possible product combinations based on a matrix of 
options



PRODUCT A
PRODUCT B
OPTION 1
Blue
x
x

Red
x

OPTION 2
Long

x

Short
x
x

A - Blue - Short
A - Long - Short

B - Blue - Long
B - Blue - Short

Obviously the actual matrix has a lot more options etc.

TIA

Chris.


--- StripMime Report -- processed MIME parts --- multipart/alternative
  text/plain (text body -- kept)
  text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/lo2p123mb7099e7363e5683360281016f8f...@lo2p123mb7099.gbrp123.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to