(Starting as a new thread)
This is with relation to the thread : thread149-1130706
This time, I am creating a sequence for a crosstab. The crosstab row is numeric like 12.0, 9.0, 9.0, 5.0 ... In this case will the seqence be generated
lbass had suggested this formula for crosstab string row and it worked great!:
whilereadingrecords;
numbervar x;
stringvar y;
if instr(y, {ProcName.Row_Name}) = 0 then
(y := y + {ProcName.Row_Name} + ", ";
x := x + 1);
x
Now, since the crosstab rowname is numeric, I changed
instr(y, {ProcName.Row_Name}) TO instr(y, totext({ProcName.Row_Name})) AND
(y := y + {ProcName.Row_Name} TO (y := y + totext({ProcName.Row_Name})
but the rows are getting repeated. For example the first three rows are the output. But after the first three rows get displayed, they get repeated. In the duplicated rows, the next sequence shows (no.4. here)
Seq Row_Name_1 Row_Name_2
1 MMM 12.0%
2 DDD 9.0%
3 GGG 9.0%
4 MMM 12.0%
DDD 9.0%
GGG 9.0%
But when I remove the ‘Seq’ from the crosstab rows, it shows up only the three rows, which is correct,
Seq Row_Name_1 Row_Name_2
1 MMM 12.0%
2 DDD 9.0%
3 GGG 9.0%
Will this same formula work to generate a sequence column for crosstab numeric rowname or is there any other way.
thanks
This is with relation to the thread : thread149-1130706
This time, I am creating a sequence for a crosstab. The crosstab row is numeric like 12.0, 9.0, 9.0, 5.0 ... In this case will the seqence be generated
lbass had suggested this formula for crosstab string row and it worked great!:
whilereadingrecords;
numbervar x;
stringvar y;
if instr(y, {ProcName.Row_Name}) = 0 then
(y := y + {ProcName.Row_Name} + ", ";
x := x + 1);
x
Now, since the crosstab rowname is numeric, I changed
instr(y, {ProcName.Row_Name}) TO instr(y, totext({ProcName.Row_Name})) AND
(y := y + {ProcName.Row_Name} TO (y := y + totext({ProcName.Row_Name})
but the rows are getting repeated. For example the first three rows are the output. But after the first three rows get displayed, they get repeated. In the duplicated rows, the next sequence shows (no.4. here)
Seq Row_Name_1 Row_Name_2
1 MMM 12.0%
2 DDD 9.0%
3 GGG 9.0%
4 MMM 12.0%
DDD 9.0%
GGG 9.0%
But when I remove the ‘Seq’ from the crosstab rows, it shows up only the three rows, which is correct,
Seq Row_Name_1 Row_Name_2
1 MMM 12.0%
2 DDD 9.0%
3 GGG 9.0%
Will this same formula work to generate a sequence column for crosstab numeric rowname or is there any other way.
thanks