Concatenate data tables in loop only works first time<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi
I have a script where I loop through a data table with random number of rows. For each row I execute 3 sql statements to get 3 tables with data. That part of the solution works fine but subsequently I want to concatenate the 3 tables produced for each row in the original table and this is where my jmp knowledge falls short.
Instead of concenate 3 tables for each row I get a result where the 3 tables from the first row are concenated as many times as there are rows. I assume I have to do something to let jmp know that the 3 tables have changed content before doing the concatenation and have tried to do so by explictly assigning the tables produced by the 3 statements (dtSite, dtCountry, dtTrial) to new names before doing the concanation but that does not do the trick. See code below.
anyone who can point me in right direction?
br
Hans Jørgen
dtSite<
dtCountry<
dtTrial<
Data Table( "Sitevalue" ) << Concatenate(
Data Table( "Countryvalue" ),
Data Table( "Trialvalue" ),
Output Table( "Combined" )
);
Re: Concatenate data tables in loop only works first timeThanks that made the difference. I struggle a bit to get the grasp of the scope of variables i jmp. but slowly I am learning
Re: Concatenate data tables in loop only works first timeIs it possible that when you read in new tables (i.e. the second time you read in the table Sitevalue) JMP is actually calling it Sitevalue 2?
If you are already pointing to the latest tables with your variables, just use them in your concatenation step instead of the name:
dtSite << Concatenate( dtCountry, dtTrial, Output Table( "Combined" ) );