- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Graph Builder - How to Nest Group X Variables?
Hello,
I'm trying to plot some data using graph builder, where serial number and response are plotted on X and Y. I'm trying to group by two variables - design and batch, but since each batch is only one design I would like to not include every batch number under each design.
I can achieve close to the results I want by nesting the X-axis, but then I cannot plot by serial #.
Any solutions for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - How to Nest Group X Variables?
You could create new column Design + Batch and use that for X Group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - How to Nest Group X Variables?
Also, why you cannot plot with serialnr if you use only X-axis? I can go from this
to this by moving my x groups to x-axis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - How to Nest Group X Variables?
Thanks jthi, your second solution worked well once I had changed the serial number from continuous to ordinal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - How to Nest Group X Variables?
Hey @HarriBradbeer
Here is a script that will combine either columns you select in the Column list box for graph builder or you select on the actual data table as well. You can put the "Combined Filter" column it creates into Group X to have the group values from the columns as levels for the Group X axis. If you select new columns and rerun the script it will update the "Combined Filter" column values.
I actually added this as a button to my toolbar to make it more streamlined.
Hope this helps!
Steve
Names Default To Here( 1 );
dt=Current Data Table();
wait(0);
curWindow = current window() << Get Window Title; //get window title to curWindow variable
//use Try to check if curWindow is datatable with << Get name or N Rows
Try(
//Show(N Rows(Datatable(curWindow))),
Datatable(curWindow) << Get Name;
test=0, //datatable
test=1; //not datatable
);
if( test==1,
dt << begin Data Update;
obj=Current Report()["Graph Builder"]<< get scriptable object;
cnames = (obj<< XPath("//OutlineBox[text()='Graph Builder']//ListBoxBox")) << get selected;
cnames=cnames[1];
dt << Select Columns( eval(cnames) );
selcols=dt << Get selected Columns();
/* Obtain a list of all numeric column names as strings. */
numCols = dt << Get Column Names();
ct=0;
/* Loop through each numeric column. */
For( i = 1, i <=N Items( numCols ) , i++,
col name = Column( i ) << Get Name;
if( col name=="Combined Filter",
ct=1;
cti=i;
break();
)
);
dt << Combine Columns(
delimiter( "," ),
Columns( eval(selcols) ),
Multiple Response( 0 ),
Column Name( "Combined" )
);
dt << Clear Column Selection();
column(dt,"Combined")<< Set Selected( 1 );
dt << Move Selected Columns( To last );
if(ct==0,
dt<<New Column( "Combined Filter", Character, "Nominal" );
column(dt,"Combined Filter")<< Set Selected( 1 );
dt << Move Selected Columns( To first );
);
dt << Move Selected Columns( To first );
for each row(dt,:Combined filter=:Combined );
try(dt << Delete Columns(Column( "Combined" ) ));
wait(0.1);
dt << Go to( eval(selcols) );
dt << End Data Update;
);
if(test==0,
dt<<begin data update;
selcols=dt << Get selected Columns();
/* Obtain a list of all numeric column names as strings. */
numCols = dt << Get Column Names();
ct=0;
/* Loop through each numeric column. */
For( i = 1, i <=N Items( numCols ) , i++,
col name = Column( i ) << Get Name;
if( col name=="Combined Filter",
ct=1;
cti=i;
break();
)
);
dt << Combine Columns(
delimiter( "," ),
Columns( eval(selcols) ),
Multiple Response( 0 ),
Column Name( "Combined" )
);
dt << Clear Column Selection();
column(dt,"Combined")<< Set Selected( 1 );
dt << Move Selected Columns( To last );
if(ct==0,
dt<<New Column( "Combined Filter", Character, "Nominal" );
column(dt,"Combined Filter")<< Set Selected( 1 );
dt << Move Selected Columns( To first );
);
for each row(dt,:Combined filter=:Combined );
try(dt << Delete Columns(Column( "Combined" ) ));
wait(0.1);
dt << Go to( eval(selcols) );
dt << End Data Update;
);