Hello, not very good with programming but slowing moving along with stuff I can google and stuff. but no matter what I try to do, the
Current Journal () << Save PDF(blah blah)
only saves the very last plot. Even though if I comment out the line above and only have
biv << Journal
the script would output Journal with 2 plots. Not sure how I can get the PDF to save both plots?
The parent code...
Data Table( "Daily Pull" ) << Join(
With( Data Table( "Key" ) ),
By Matching Columns( :Name( "Hello" ) = :Name( "Hello" ) ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);
biv = Bivariate(
SendToByGroup( {:Recipe == "Pizza"} ),
Y( :VALUE ),
X( :PROCESS_DATE ),
By( :Recipe ),
SendToByGroup(
{:Recipe == "Pizza"},
SendToReport(
Dispatch(
{"Bivariate Fit of VALUE By PROCESS_DATE Recipe=Pizza"},
"2",
ScaleBox,
{Min( 150 ), Max( 210 ), Inc( 5 ), Minor Ticks( 0 )}
),
Dispatch(
{"Bivariate Fit of VALUE By PROCESS_DATE Recipe=Pizza"},
"Bivar Plot",
FrameBox,
{Row Legend(
:ENTITY,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
SendToByGroup(
{:Recipe == "Rice"},
SendToReport(
Dispatch(
{"Bivariate Fit of VALUE By PROCESS_DATE Recipe=Rice"},
"2",
ScaleBox,
{Min( 200 ), Max( 260 ), Inc( 5 ), Minor Ticks( 0 )}
),
Dispatch(
{"Bivariate Fit of VALUE By PROCESS_DATE Recipe=Rice"},
"Bivar Plot",
FrameBox,
{Row Legend(
ENTITY,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
)
);
jrn = biv << Journal jrn << SavePDF( "$DOCUMENTS\test.pdf" );I think there is a missing semicolon on the last line:
jrn = biv << Journal<FONT face="arial black,avant garde"><STRONG>;</STRONG></FONT> jrn << SavePDF( "$DOCUMENTS\test.pdf" );
Even with this semicolon, the script does not do what you expect. The issue is that the return value of (biv<
{Bivariate[], Bivariate[]}
So the <
biv << Journal; Current Journal() << SavePDF( "$DOCUMENTS\test.pdf" );
If you prefer to save the PDF directly from the report instead of creating a journal, you can do something like:
(biv[1]<<TOPPARENT></TOPPARENT>
This does assume that biv is a list, which will not be the case if you ever run the script on data with only a single level of the by-variable. If you need to handle both cases, you might use something like:
If (IsList(biv),rpt=(biv[1]<<TOPPARENT></TOPPARENT>