Hola, estoy teniendo problemas para usar un bucle for para crear algunos gráficos. Tengo una lista de palabras y quiero que se seleccionen de la tabla de datos y se introduzcan en una grpah. Quiero que esto se haga varias veces con diferentes palabras. He incluido lo que tengo hasta ahora, sin embargo, mi bucle for solo hará la primera palabra en la lista.
También hay un bucle si hay un bucle allí, ya que solo quiero que se construya el gráfico si hay un número de coincidencias mayor que 0
graph = {"abc", "123"};
n_g = N Items( graph );
For( i = 1, i <= n_g, i++,
dt << Select Where( Contains( :Column, graph[i] ) );
num = N Rows( dt << get selected rows );
If( num > 0,
mess = Char( num ) || " from" || Char( graph[i] );
dt << Subset(
Output table name( " from " || Char( graph[i] ) ),
Selected Row( 1 ),
Selected Column( 0 )
);
biv = Graph Builder(
Size( 1300, 1100 ),
Show Control Panel( 0 ),
Variables( X( :Slack ), Y( :Comb ) ),
Elements( Points( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch( {}, "Slack", ScaleBox, {Add Ref Line( 0, "Dashed", "Medium Dark Red", "", 4 )} ),
Dispatch( {}, "Comb", ScaleBox, {Add Ref Line( 25, "Dashed", "Medium Light Yellow", "", 4 )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Text Annotation( Text( mess ), Text Box( {8, 14, 251, 34} ) )}
)
)
);
jrn << Append(
Outline Box( "from " || Char( graph[i] ),
Text Box( "There are" || Char( n_g ), Markup( 1 ) ),
m << New Data Box(),
biv << Report
)
);
,
jrn << Append(
Outline Box( " from " || Char( graph[i] ),
Text Box( "There are no paths that begin with " || Char( graph[i] ), Markup( 1 ) )
)
);
);
dt << Clear Select();
);
La sintaxis correcta para su subconjunto es
dt << Subset(
Output table name( " from " || Char( graph[i] ) ),
Selected Rows( 1 ),
Selected Columns( 0 )
);
Además, no veo el código de la revista a la que está adjuntando. Asumo, el
jrn << Append(
Outline Box( "from " || Char( graph[i] ),
Text Box( "There are" || Char( n_g ), Markup( 1 ) ),
m << New Data Box(),
biv << Report
)
);<BR />
La referencia jrn se encuentra en alguna parte anterior en el código y simplemente no se incluye en este recorte.