>Chris, > >I did as you suggested but I don't see that the output from >CategoryStatistics contains all of the data fields. For example, the data >field in the Categorical.net contains customer and income data for 3 >states. After I use the CategoryStatistics on the income data, the result >includes the maximum value of income for each of the 4 states but it >doesn't include the what customer data is associated with each of those >max income values. Is there a way to get that value? > >thanks, >Susan Schwarz >Research Computing >Dartmouth College
Try this. Add Lookup after CategoryStatistics (in the sample categorical.net). Connect CategoryStatistics->Lookup ("input") and ImportSpreadsheet ("data" output) -> Lookup ("table"). Open Lookup, Expand to see the hidden tabs, and edit as follows: Input Name Value data "data" lookup "income" value "customer" destination "lookedup" Print("rd") the output of Lookup. You should see the customer number corresponding to each of the 4 states' max incomes. Why? Lookup used the "data" in the CategoryStatistics output field as the values it was looking up in the "income" component array of the original input field (where all possible incomes reside). Since both "income" and "customer" arrays are dependent (i.e., to be found in the same order) on "positions", finding the "position" index of a value in the "income" array tells you the index into the "customer" array where you'll find the customer id number (again, in the original input). So you use CategoryStatistics to find the 4 values out of the complete input data set of max "income", then you Lookup the corresponding 4 values of "customer" by the shared positional index (which, by the way, never actually appears anywhere). There is a proviso: Lookup stops on the first successful match. Be aware that if you had more than one gene that has the max value, you will only see the first hit in the output. You might want to run "count" against your value component to see if the max value has more than one occurrence, then do something appropriate. THAT exercise is left to the reader. Or, that's where I start getting consulting fees... You can change "lookedup" to some other name (including one you make up, or to "data"). That is the component in the output field that gets the results of Lookup. The other names are specific to the fields you are feeding in: so in this case, they are quite specific. BTW, I've used Lookup for years and I ALWAYS have to lookup the meaning of the inputs. (:-) Chris Pelkie Scientific Visualization Producer Cornell Theory Center 618 Rhodes Hall Cornell University Ithaca, NY 14853-3801 [EMAIL PROTECTED] 607-254-8794