I want to add a new column (TAinfo-Day & TAinfo-Arm) in an existing table (SM) containing for each row the concatenation as a string of the N rows of a linked table (TA) that match define conditions: T-DAY =< S-DAY
SM & TA Keys: Study, Group
Constraint, I'm using Spotfire 7.11 which permit to use R script but NOT useful packages like library(dplyr)
I succeed to create new temporary table SMtemp that contain the desire data from TA but spread over several rows.
Next step should be to aggregate those.
TA TA
Study <K> Group <K> Arm T-Day
20190510 01 A1 1
20190510 01 A2 21
20190510 01 A3 35
20190510 02 B1 1
20190510 02 B2 22
20190510 02 B3 35
The Objectif is to create the columns "TAinfo-Day" & "TAinfo-Arm"
SM SM
Study <K> SampleID Group <K> S-Day TAinfo-Day TAinfo-Arm
20190510 20190510-01.001 01 21 1,21 A1,A2
20190510 20190510-01.001 01 36 1,21,35 A1,A2,A3
20190510 20190510-01.002 01 21 1,21 A1,A2
20190510 20190510-01.002 01 36 1,21,35 A1,A2,A3
20190510 20190510-01.003 01 21 1,21 A1,A2
20190510 20190510-01.003 01 36 1,21,35 A1,A2,A3
20190510 20190510-02.001 02 21 1 B1
20190510 20190510-02.001 02 36 1,22,35 B1,B2,B3
20190510 20190510-02.002 02 21 1 B1
20190510 20190510-02.002 02 36 1,22,35 B1,B2,B3
20190510 20190510-02.003 02 21 1 B1
20190510 20190510-02.003 02 36 1,22,35 B1,B2,B3
SMtemp
Study <K> SampleID Group <K> S-DAY T-DAY
20190510 20190510-01.001 01 21 1
20190510 20190510-01.001 01 21 21
20190510 20190510-01.001 01 36 1
20190510 20190510-01.001 01 36 21
20190510 20190510-01.001 01 36 35
20190510 20190510-01.002 01 21 1
20190510 20190510-01.002 01 21 21
20190510 20190510-01.002 01 36 1
20190510 20190510-01.002 01 36 21
20190510 20190510-01.002 01 36 35
20190510 20190510-01.003 01 21 1
20190510 20190510-01.003 01 21 21
20190510 20190510-01.003 01 36 1
20190510 20190510-01.003 01 36 21
20190510 20190510-01.003 01 36 35
20190510 20190510-02.001 02 21 1
20190510 20190510-02.001 02 36 1
20190510 20190510-02.001 02 36 22
20190510 20190510-02.001 02 36 35
20190510 20190510-02.002 02 21 1
20190510 20190510-02.002 02 36 1
20190510 20190510-02.002 02 36 22
20190510 20190510-02.002 02 36 35
20190510 20190510-02.003 02 21 1
20190510 20190510-02.003 02 36 1
20190510 20190510-02.003 02 36 22
20190510 20190510-02.003 02 36 35
Many thanks in advance for your help.