Ok, Robert G designed the Initial and I've used it all over

<pre>
1. <@assign local$warrs <@filter domain$warrs "#parentSku = '<@var local$sku>' and #web_or_dash != 'D'">> 2. <@define local$sku_compare2 type=array cols=<@numcols array=domain $products> rows=<@numrows array=local$warrs>>
3. <@assign local$sku_compare2[0,*] <@var domain$products[0,*]>>
4. <@assign local$sku_compare2[*,sku] <@var local$warrs[*,sku]>>
5. <@assign local$warrProds <@intersect array1=domain$products array2=local$sku_compare2 cols=sku alpha>>
</pre>

let me explain
(remember @intersect needs the 2 arrays to be identical in columns, so we are going to create an array from the small array) in this example we have a domain var holding thousands of products and a small array xref array for warranty skus

line 1. gets the list of warranty skus based on a parent sku (so filter used here) this returns an array that has parentSKU and warrSKU columns
line 2. creates a shell array using the domain$products structure
line 3. takes the 0 row (column names from domain$products and populates our new shell
line 4. populate the shell array with the warranty skus
line 5. do the intersect using the sku column as compare.

this is amazingly fast and no looping

Ben


On Mar 13, 2008, at 3:09 PM, John Hotaling wrote:

Hello:
I’m looking for the most efficient way to create a “subset” array from another “master” array (I’ll need to create several subset arrays actually). However, I don’t want to do any looping to create it due to performance concerns.

I’ve used the <@delrows> meta-tag and that works fine but I am trying to simplify my approach some. I thought it may be easier using the <@filter> tag but I need to pull the subset based on the “index” row value (that’s not a value currently in the array). I thought there might be a <@subset> type meta-tag but didn’t see anything like that after reviewing the docs.

Any input is greatly appreciated.

Thank you.
John

==============================================================
John Hotaling
[EMAIL PROTECTED]
www.AuctionAnything.com

AuctionAnything.com, Inc.
==============================================================

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to