cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Priyank
Level II

How to sort week number across year using JSL (JMP12)?

I have data by week number from Oct 2016 to the current week.  I want to show the week numbers in correct order on the X-axis on bar chart going from week 48, 49, 50, 51, 1,2,3 etc. Or value ordering for WeekNumber column in the order of time stamp can help.

I created Year as another column and used Year axis along with WeekNum on Bar chart. But it didn't work as expected. please see the attached charts. Left one is the one I am getting right now, and the right one is the desired one. For a small dataset, we can reorder the WW values but it's tedious for a large data set. 

I am using JMP12, it will be a big help if anyone can suggest a solution.

 

 BarCharts.PNG

 

 

4 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How to sort week number across year using JSL (JMP12)?

Without seeing what you want your final product to look like, I will guess that what you may need to do is to change the Year and work week moding types to ordinal.  Assuming the year and word week columns are numeric that should make the axis work out the way you want it to.

Jim

View solution in original post

Priyank
Level II

Re: How to sort week number across year using JSL (JMP12)?

Thanks Jim. Yes, WW and Year are in numeric. but it didnt work out with ordinal modeling types for these columns. 

Please see the attached chart. Desired chart is in the right and the one i am getting is in the left. Notice the week numbers. I had to reorder the week numbers to 49, 50, 51, 52, 1, 2.. which is quite tedious with large data set. Also i want to put it in script. 

 

BarCharts.PNG

View solution in original post

txnelson
Super User

Re: How to sort week number across year using JSL (JMP12)?

If you use Chart Builder, setting Year and Work Week to Ordinal and dragging both of them at the same time to the X axis and then drag the Y variable to the Y axis you will get the below chart

work week.PNG

Jim

View solution in original post

Priyank
Level II

Re: How to sort week number across year using JSL (JMP12)?

Thanks so much for the help Jim. It worked.

Now i have to add this capability into my script. Was looking on web but didnt find any solution. Please let me know if you can suggest something.  

View solution in original post

6 REPLIES 6
txnelson
Super User

Re: How to sort week number across year using JSL (JMP12)?

Without seeing what you want your final product to look like, I will guess that what you may need to do is to change the Year and work week moding types to ordinal.  Assuming the year and word week columns are numeric that should make the axis work out the way you want it to.

Jim
Priyank
Level II

Re: How to sort week number across year using JSL (JMP12)?

Thanks Jim. Yes, WW and Year are in numeric. but it didnt work out with ordinal modeling types for these columns. 

Please see the attached chart. Desired chart is in the right and the one i am getting is in the left. Notice the week numbers. I had to reorder the week numbers to 49, 50, 51, 52, 1, 2.. which is quite tedious with large data set. Also i want to put it in script. 

 

BarCharts.PNG

txnelson
Super User

Re: How to sort week number across year using JSL (JMP12)?

If you use Chart Builder, setting Year and Work Week to Ordinal and dragging both of them at the same time to the X axis and then drag the Y variable to the Y axis you will get the below chart

work week.PNG

Jim
Priyank
Level II

Re: How to sort week number across year using JSL (JMP12)?

Thanks so much for the help Jim. It worked.

Now i have to add this capability into my script. Was looking on web but didnt find any solution. Please let me know if you can suggest something.  

txnelson
Super User

Re: How to sort week number across year using JSL (JMP12)?

Are you asking, what is the JSL to do this chart?  If this is your question, just go ahead and interactively create the chart, then go to the red triangle, click on it and got to Save the Script.  You will get the code required to regenerate the chart.

Jim
fannah
Level I

Re:How to customize the WW in JMP14?

I have data I am looking at and I want work week to start in October that is Oct 1 will be WW1.