On Mar 15, 2008, at 1:29 PM, John Hotaling wrote:

Hi Ben:
Thanks for the feedback. Your method to create a subset array is pretty creative. I’m still trying to figure out how to make best use of the information. I have a few variables involved that are creating a challenge and may take another look at it today.

For one, my initial “master” array is created from an uploaded file and therefore doesn’t have a “0 row”. This can be created manually I suppose, but the bigger challenge is that I don’t have a match field like your sku. Does Witango provide a “0 column” reference (i.e. just a numerical index) similar to the “0 row”? I don’t think it does, but if so, that would make this an easy task since I need to create my subset arrays strictly based on that value. For example, I need to pull records 1-50, 51-100, 101-150 etc.


Yes. But you must populate column zero with a string (non-integer). Otherwise references using column zero are ambiguous. Ex. @@request $array[name, three] gives the value at the intersection of row 0 = 'name' and column 0 = 'three'.

I was able to tackle this based on using the <@delrows> meta-tag, but I thought there would be a better way. My current approach processes pretty fast, so I guess having it as a fall back will work for now too.


Thanks again,
John

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

AuctionAnything.com, Inc.
509 S. Chickasaw Trail #168
Orlando, FL 32825-7852
Tel: 407.282.8568 Ext 160
Fax: 407.540.9574
==============================================================
From: Ben Johansen [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2008 6:29 PM
To: [email protected]
Subject: Re: Witango-Talk: Array subset creation

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 ______________________________________________________________________ __ 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