cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Lookups working really slowly.

ptc-4688081
1-Newbie

Lookups working really slowly.

Hi All,

I'm new here although have been using Mathcad since the DOS days. Mostly pretty basic stuff for electronics.

I have a document that generates 16k values. I need to use each of these to return a value from a lookup table & then process those 16k values further. The lookup table exists at the moment in an Excel file which I read into Mathcad. I then do a vlookup within Mathcad. The lookup table is 262k lines long & the sheet takes forever to run. I want to extend the lookup table to >1M values in the future.

Untitled.jpg

Codei contains the 16k values I generate. DACLookup is the 262k line lookup table I import. The vlookup line surrounded by the green box is the one that takes foreever.

The only workable solution I found so far is to export my data to Excel. Use that to do the lookup & then import the values back to Mathcad for processing further. It's all very manual though.

Anyone have any ideas on how to get Mathcad to do it all but workably fast - I set the document running way before I started writing this & it hasn't finished yet!!!

Thanks, Dave.

3 REPLIES 3

This may be the one time it makes sense to embed an EXCEL spreadsheet. You can insert an EXCEL sheet,put your "Code" vector as input, and define an output range for "DACOut." And do the lookup in the embedded EXCEL.

RichardJ
19-Tanzanite
(To:ptc-4688081)

Well, you are doing 16k lookups on a very large table. Maybe there's an alternative to a lookup. What is T, and what is in the lookup table?

StuartBruff
23-Emerald II
(To:RichardJ)

Richard Jackson wrote:

Well, you are doing 16k lookups on a very large table. Maybe there's an alternative to a lookup.

There is a very good chance that there is an alternative ...

5s for a 160,000 lookups on a 2,620,000 row table on my ancient dual-core, 4GiB RAM system.

Stuart

Top Tags