cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
saitcopuroglu
Level IV

Different Data Filters for multiple analysis, possible?

I have a table and producing different graphs but each graph needs to be data filtered differently. What I am experiencing is the first Data Filter won't change and will overwrite the following data filter which means I only can use 1 Data Filter script for multiple reports. Should I write a "clear row states" before each new Dat Filter? The blow example consist of 2 Data Filters but whatever I do the second Data Filter is ignored by JMP, only and always the first one is valid.

Could anyone share his/her experiences/solutions?

Thank you

dt_master = Open( "AccomodationBudget.jmp" );

Open( "AgencyStayREALDATAfin.jmp" );

//Summary REALDATA

Data Table( "AgencyStayREALDATAfin.jmp" ) << Summary(

  Group( :Label, :Month, :Contract, :Room Type ),

  Mean( :RoomDiscount% ),

  Sum( :NetRoomRevenueWithOutVat ),

  Sum( :RoomNight ),

  Sum( :AdultNight ),

  Sum( :BrutRoomRevenue ),

  Sum( :RoomDiscount ),

  statistics column name format( "column" ),

  Link to original data table( 0 )

);

//Concatenate

Data Table( "AccomodationBudget.jmp" ) << Concatenate(

  Data Table( "AgencyStayREALDATAfin By (Label, Month, Contract, Room Type).jmp" ),

  Keep Formulas,

  Append to first table

);

//DATA FILTER 1

Current Data Table() << Data Filter(

  Location( {324, 0} ),

  Mode( Select( 0 ), Include( 1 ) ),

  Add Filter( columns( :Label ), Where( :Label == {"Budget", "2015"} ), Display( :Label, Size( 102, 59 ), Check Box Display ) )

);

//Double Occupancy Performance by Month

Graph Builder(

  Size( 1263, 871 ),

  Show Control Panel( 0 ),

  Legend Position( "Right" ),

  Auto Stretching( 0 ),

  Title Fill Color( "Light Blue" ),

  Title Frame Color( "Medium Dark Gray" ),

  Level Fill Color( {174, 203, 228} ),

  Level Frame Color( "Medium Dark Gray" ),

  Level Underline( 1 ),

  Variables( X( :Month ), Y( :RoomNight ), Y( :RoomNight ), Overlay( :Label ) ),

  Elements(

  Position( 1, 1 ),

  Bar( X, Y, Legend( 3 ), Bar Style( "Single" ), Summary Statistic( "Sum" ), Label( "Value" ) ),

  Caption Box( X, Y, Legend( 6 ), Summary Statistic( "Sum" ), X Position( "Right" ), Y Position( "Top" ) )

  ),

  Elements(

  Position( 1, 2 ),

  Bar( X, Y, Legend( 5 ), Bar Style( "Single" ), Summary Statistic( "% of Total" ), Label( "Value" ) ),

  Caption Box( X, Y, Legend( 7 ), Summary Statistic( "% of Total" ), X Position( "Right" ), Y Position( "Top" ) )

  ),

  SendToReport(

  Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Room Night Performance by Month [Budget vs 2015]" )} ),

  Dispatch(

  {},

  "Month",

  ScaleBox,

  {Min( -0.5 ), Max( 6.5 ), Inc( 1 ), Minor Ticks( 1 ), Show Minor Grid( 1 ), Inside Ticks( 1 ), Rotated Labels( "Horizontal" )}

  ),

  Dispatch( {}, "RoomNight", ScaleBox, {Show Major Grid( 1 ), Show Minor Grid( 1 ), Inside Ticks( 1 )} ),

  Dispatch(

  {},

  "RoomNight",

  ScaleBox( 2 ),

  {Format( "Percent", Use thousands separator( 0 ), 12, 2 ), Max( 0.4 ), Show Major Grid( 1 ), Show Minor Grid( 1 ), Inside Ticks( 1 )}

  ),

  Dispatch(

  {},

  "400",

  ScaleBox,

  {Legend Model(

  3,

  Properties( 0, {Line Color( -4222675 ), Fill Color( -4222675 )} ),

  Properties( 1, {Line Color( -13647958 ), Fill Color( -13647958 )} ),

  Properties( 2, {Line Color( -2994485 ), Fill Color( -2994485 )} )

  )}

  ),

  Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),

  Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),

  Dispatch( {}, "", AxisBox( 2 ), {Add Axis Label( "RoomNight Sum by Month" ), Add Axis Label( "Ay Bazinda Toplam Gece Konaklama " )} ),

  Dispatch( {}, "Graph Builder", FrameBox, {Left( 1 ), Right( 1 ), Top( 1 ), Bottom( 1 )} ),

  Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( "% of Total RoomNight By Month" )} ),

  Dispatch( {}, "", AxisBox( 3 ), {Add Axis Label( "Ay Bazinda Toplam Gece Konaklama Yüzdesel Dagilimi" )} ),

  Dispatch(

  {},

  "Ay Bazinda Toplam Gece Konaklama Yüzdesel Dagilimi",

  TextEditBox,

  {Set Text( "Ay Bazinda Gece Konaklama Yüzdesel Dagilimi" )}

  )

  )

);

//DATA FILTER 2

Current Data Table() << Data Filter(

  Location( {437, 0} ),

  Mode( Select( 0 ), Include( 1 ) ),

  Add Filter( columns( :Label ), Where( :Label == {"Budget", "2015", "2014"} ), Display( :Label, Size( 102, 59 ), Check Box Display ) )

);

//Double Occupancy Performance by Market Code

Graph Builder(

  Size( 1263, 629 ),

  Show Control Panel( 0 ),

  Title Fill Color( "Light Blue" ),

  Title Frame Color( "Medium Dark Gray" ),

  Level Fill Color( {174, 203, 228} ),

  Level Frame Color( "Medium Dark Gray" ),

  Level Underline( 1 ),

  Variables( X( :Contract ), Y( :DoubleOcc ), Overlay( :Label ) ),

  Elements( Bar( X, Y, Legend( 2 ), Bar Style( "Single" ), Summary Statistic( "Mean" ), Label( "Value" ) ) ),

  SendToReport(

  Dispatch( {}, "Contract", ScaleBox, {Show Minor Grid( 1 ), Inside Ticks( 1 )} ),

  Dispatch(

  {},

  "DoubleOcc",

  ScaleBox,

  {Min( 1.39439277722467 ), Max( 2.4 ), Inc( 0.2 ), Minor Ticks( 1 ), Show Major Grid( 1 ), Show Minor Grid( 1 ), Inside Ticks( 1 )}

  )

  )

);

10 REPLIES 10
saitcopuroglu
Level IV

Re: Different Data Filters for multiple analysis, possible?

Thank you Michael,

Thank you PMroz,

I learned a lot from you today.

Both seems to work with indifference to .html output.