Choose Language Hide Translation Bar
Level III

Custom re-order of columns

My jsl script produces the following table which is the combination of summary,split and update functions.

The first few columns have actual mesureamnts for variuos test for past four months and week wise for the current month(new week gets added every sunday). The last 4 columns are expected values for each month for each test.The following are two things I'm trying-

Also my script already has 250 lines so trying to do this in a few lies of code.

1.Rename last 4 columns as Expected,MM08 and so on..The jsl I wrote doesnt work.Mostly because the last four columns(result of update function) get locked.I wrote a jsl to unlock these but that doesnt work too.


for(f=1,f<= Nitems(colNamesList),f++,
	if(word(1,colNamesList[f]) == "N",
		Column(colNamesList[f])<< set name(
			"Expected," || word(2,colNamesList[f])

2.I need tp reorder columns such that Actual and expected values for a month are side by side.I re-arrange column function doesnt have a custom oredr option.



Current table -

Test NameActual, MM08Actual, MM09Actual, MM10Actual, MM11 OneActual, MM11 TwoActual, MM11 ThreeN, MM08N, MM09N, MM10N, MM11
Test A0.2210.99811110666
Test B 1100.516900466
Test C3.38901E-150.98530.99781112444
Test D1.54046E-14     10000
Test E7.00209E-140.41010.77070008866
Test F3.18277E-130.55810.73780.219550.409450.74916444
Test AA1.44671E-12111112222
Test BC6.57597E-12110.86570.516914444
Test CA2.98908E-11     2000


Expected output-

Test NameActual, MM08Expected, MM08Actual, MM09Expected, MM09Actual, MM10Expected, MM10Actual, MM11 OneActual, MM11 TwoActual, MM11 ThreeExpected, MM11
Test A0.220160.998161116
Test B 0141600.516906
Test C3.38901E-1520.985340.997841114
Test D1.54046E-1410 0 0   0
Test E7.00209E-1480.410180.770760006
Test F3.18277E-1360.558140.737840.219550.409450.74914
Test AA1.44671E-12212121112
Test BC6.57597E-12414140.86570.516914
Test CA2.98908E-112 0 0   0



Level III

Re: Custom re-order of columns

I think my second problem can be resolved by naming columns in the format MM08,Actual and so on.

If I do this I can re-arrange columns by column name to have actual and expected columns side by side.


But still not able to programatically rename last four columns since they are locked.


If there is any better way,please suggest.

Article Labels

    There are no labels assigned to this post.