Choose Language Hide Translation Bar
Highlighted
DL723
Level II

Using the Match Column Values in sql queries

Hi,

   I'm trying to pull columns from an excel file to query a sql database.  I saw there was a filter for Matching by a column, which does exactly what I want.  But when I went to the source script, I noticed it calls out the data it pulled from the columns.  I can't seem to figure out what the UI section does, since it also lists the file name twice.

 

Is there a way to script a generic version where I don't need to a have the lotIDs and file names listed out already?  I couldnt find the Match Column Values() function in the scripting index.  Thanks

 

From( Table( "Results Database", Schema( "X" ), Alias( "t1" ) ) ),
Where(
In List(
Column( "LotID", "t1" ),
{"123", "456"},
UI(
Match Column Values(
"Subset of Sheet1",
"Subset of Sheet1.jmp",
"lotID",
SelectedRows( 0 ),
Base( "Categorical" )
)
)
1 REPLY 1
Highlighted
DL723
Level II

Re: Using the Match Column Values in sql queries

Ok i've gotten it generic enough where I don't need the table names...but I still can't figure out how to get the list going without listing everything out.

 

The code below works where I had previously had a variable pull the column values as a list.  the variable lots2 contains all the lot number ids.  But I have to list out all 3 lot ids i had in that array.  Is the only way to do this is to create a loop and keep querying the database?  Or is there a way to just do a single query like below?  Thanks

 

 

In List(
			Column( "LotID", "t1" ),
			{lots2[1], lots2[2], lots2[3]},
			UI(
				Match Column Values(
					twox << get name,
					"2x.jmp",
					"lotID",
					SelectedRows( 0 ),
					Base( "Categorical" )
				)
			)
Article Labels

    There are no labels assigned to this post.