cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
nyeesg
Level I

How to split the data and plot the graphs based on date

I have the data for 2  years (2011 to 2013) with a date column in 'YYYY-MM-DD' format, I want to split the data into monthly  parts i.e 2011 Jan - Feb.... to 2013 Nov and also plot histogram calculate the total no case reported each month for period of 2 yeaer.

Please let me know  how can I split the data and the plot a line graph to compare the performance. I m very new to JMP. Kinldy assist

CASE ID                  DATE

BNZ123-2424      30/9/2011  1:34:00 PM

BNZ123-2425      31/9/2011  1:34:00 PM

4 REPLIES 4
imroze
Level I

Re: How to split the data and plot the graphs based on date

HI nyeesg,

Regards to split the data monthly, the below article might be helpful.

Please check..

<http://www.sascommunity.org/mwiki/images/3/39/040-2012.pdf>

Thank You

pmroz
Super User

Re: How to split the data and plot the graphs based on date

Here's how to do it in JMP:

This code creates the table you listed:

dt = New Table( "My Cases", Add Rows( 2 ),

    New Column( "Case ID", Character, Nominal,

        Set Values( {"BNZ123-2424", "BNZ123-2425"} )

    ),

    New Column( "Date", Character, Nominal,

        Set Values( {"30/9/2011  1:34:00 PM", "31/9/2011  1:34:00 PM"} )

    )

);


The next block of code creates a new column called Monthly Date, which uses a formula based on the Date column.  You can use Monthly Date on the X axis in graph builder.

dt << New Column( "Monthly Date", Numeric, Nominal, Format( "m/y", 12 ),

        Input Format( "m/y" ),

        Formula(

            date_list = Words( :Date, "/ " );

            Informat( date_list[2] || "/" || date_list[3], "m/y" );

        ),

);


This block of code creates a new column called Monthly Date, which uses a formula based on the Date column.  You can use Monthly Date on the X axis in graph builder.

nyeesg
Level I

Re: How to split the data and plot the graphs based on date

New Column( "Case ID", Character, Nominal,

        Set Values( {"BNZ123-2424", "BNZ123-2425"} )

My dataset contains abt 10000 caseids.. how to do set the caseid and date explicitly .


    New Column( "Date", Character, Nominal,

        Set Values( {"30/9/2011  1:34:00 PM", "31/9/2011  1:34:00 PM"} )

    )

)

    ),

pmroz
Super User

Re: How to split the data and plot the graphs based on date

Ignore that part of the code - that just creates a little table to play with.  The part you want to run is the second part:

dt = current data table();

// This adds the new formula column

dt << New Column("Monthly Date", Numeric, Nominal, Format("m/y",12 ),

        Input Format( "m/y" ),

        Formula(

            date_list = Words( :Date, "/ " );

            Informat( date_list[2] || "/" || date_list[3], "m/y" );

        ),

);

Recommended Articles