Skip to main content
1-Visitor
Jan 14, 2015 1:15 AM UTC
Solved

Extract data from multiple tables

Hello everyone

I have to extract values from different tables, so according to the selected component, the required values are obtained. There is a way to do this automatically.

Attached is a sheet with what I intend to do

RichardJAnswer
19-Tanzanite
Jan 14, 2015 3:11 PM UTC

Does this do what you want?

10 replies

Werner_E
25-Diamond I
Jan 14, 2015 1:50 AM UTC

The data you need can easily be extracted by the use of "vlookup".

1.png

If you always need the combination of values give in your sheet, you would create a function to do this in one call.

I am not sure, though, how you would intend to generalize the problem as you write in your sheet "for example with two data tables".

Translate
BPP1-VisitorAuthor
1-Visitor
Jan 14, 2015 2:33 AM UTC

Use the "vlookup" command is a good option, but the problem arises when you have multiple tables of data, and have to find that table contains the required value, which takes a long time, so I think the best option would create a function to do this.

Translate
Werner_E
25-Diamond I
Jan 14, 2015 10:54 AM UTC

... but the problem arises when you have multiple tables of data, and have to find that table contains the required value, which takes a long time ...

??? its unclear to me what you need. A program would not be able to find that one value which you require because it can't read your mind. You will have to specify in some way how to distinguish between the one value you require and the others in the same row.

Translate
RichardJ19-TanzaniteAnswer
19-Tanzanite
Jan 14, 2015 3:11 PM UTC

Does this do what you want?

Translate
BPP1-VisitorAuthor
1-Visitor
Jan 14, 2015 3:51 PM UTC

Has every reason Werner, I have made many mistakes in the formulation of the question by not including the headers of the components in Excel, and not put as a string to the desired variables "A", etc. What I was trying to achieve is precisely what you and Richard displayed with the function "get_value".

Thank you very much to you and Richard for taking the time to help me and sorry for generating misunderstandings.

Translate
1-Visitor
Jan 17, 2015 1:27 PM UTC

Mine solution:

2015-01-17_212234.jpg

I have read the http://communities.ptc.com/message/268914 , and I think "BBP" needs this function.

Translate
Werner_E
25-Diamond I
Jan 17, 2015 3:21 PM UTC

I have read the http://communities.ptc.com/message/268914 , and I think "BBP" needs this function.

Or something like the attached which I had created but Richard was faster 😉

The main problem Bryan had, as I understood, was that he has multiple tables to pick values from.

Anyway - he seems to be happy with Richard's solution.

BTW, if you want to make your approach ORIGIN-aware (and I think you want as you used ORIGIN+1), you should not use index zero in match() or column number "cols(y)-1" in submatrix().

Translate