10 tips for making analytics converts out of your colleagues

From the Analytically Speaking panel discussion this morning -- a live webcast I watched with hundreds of other people -- I picked up a multitude of strategies for helping co-workers, managers and executives become comfortable with using analytics to inform decision-making. Here are 10 of my favorite tips from that discussion:

  1. Start telling stories, Sameer Vittal of GE Energy said. You may know how to talk p-values and logistic regression, but the best approach is to use the data to tell stories that have an emotional component. “People who you think would be defensive, won’t be.”
  2. Show concretely what analytics can do for your business, advised Vicki Barbur of Cardinal Health. She gave an example of solving the problem of variability in a process. “It was very demonstrable where the variability was coming from.” She could point to the data, causes and procedures, and that was a turning point in her journey in analytics and statistics. “It brought the naysayers on board.”
  3. It’s the visuals, Don Lifke of Sandia National Labs said. “If you really want to sell them [on the value of analytics], it has to be about the visual.” Don’t show them a table of numbers; show a graphic. Gordon Linoff of Data Miners Inc., explained the power of visuals this way: If your managers see a table of numbers, they will think about the numbers. If you show them a graphic, they may think of solutions, improvements and innovative ideas.
  4. It’s OK to start with Microsoft Excel, panelists agreed. “It’s a bridge to the future,” Barbur said. Let your colleagues become comfortable with the data using Excel, and then they can move to an analytics tool like JMP. “Spreadsheets can be a very powerful ally. People will use what they are familiar with. Use Excel as a starting point,” Vittal said. Linoff added: “Spreadsheets can’t do everything, and when they can’t, bring in another tool.”
  5. Make your data visualizations effective, they said. Colors are linked to emotions, Vittal noted, so be sure to use the right colors. Avoid inconsistency in the use of colors across a series of graphs, Linoff added. Consider your audience and tailor your data visualization to that audience, Barbur said. Watch out for misleading data visualization, such as the misuse of area in a visualization of geographic data, Lifke said.
  6. Users groups can speed the spread of analytics. “We created our own users group [at Cardinal Health]. It lets us talk openly about our projects,” Barbur said. Plus, it brings together colleagues in different divisions and at different sites around the world.
  7. Reward analytic success. The Cardinal Health JMP Users Group gives a quarterly award -- a prize and a plaque -- to a group member who used analytics to improve the business.
  8. Rely on examples. To explain what predictive modeling is to someone with a business background, share an example that is meaningful to that person. For instance, tell him or her: If you knew what type of message you should communicate to customers, you would increase response rates by a certain percent -- that’s what predictive modeling can do.
  9. Take advantage of dynamic visualizations, Lifke advised. Use the interactive Prediction Profiler in JMP to show the power of statistical modeling. “You move one variable, and the output changes.”
  10. Be respectful and helpful. Engineers should recognize that colleagues with MBAs just have taken a different path, not an inferior one, Vittal said. On the business side, colleagues have their own pressures, so your approach should be, “What can I do to make your job easier?” It should not be to show who’s the smartest person in the room. Give them the tools -- graphs for PowerPoints, bubble plots -- to thrive. “Then they become your greatest advocates.”

What works for you? How do you make your colleagues into analytic converts?

And if you missed the live webcast today, don’t worry -- we’ll have a recording of it on our website soon. Meanwhile, check out the upcoming webcasts in the Analytically Speaking series.

Post a Comment

Making better predictive models quickly with JMP

There are many ways of generating a model such as basic linear regression, decision trees, neural nets, and generalized linear models. JMP Pro can be a great tool for data miners, those who want to get more information out of their data and build more accurate predictive models. It incorporates traditionally complicated algorithms that, in true JMP fashion, even a novice can harness to quickly build powerful models. Bootstrap forests, boosted trees and multilayered-boosted neural nets are just a sample of the powerful tools in JMP Pro. One thing that makes JMP Pro a powerful data mining tool is ability to build, tune and test your model in one step.

A while back, this blog featured a great post on the concept of training, validation and test sets to build your models. To build a model that is not only descriptive but also predictive, validating your model and subsequently testing it is essential.

The first step, as described in the blog entry, was to first split your data into three groups: training, validation and test portions. Next, you build a model based on the training portion of your data that has captured the behavior of the data (your system) and not just the noise. Once you've come up with a legitimate model, you apply that model to the validation set. If you've built a model that captures the underlying behavior, you should get similar behavior. If you do not, you have to go back and build another model; this process may go back and forth a few times. Once you get a model that gives similar behavior in the validation built with the training set, you expect the model to be repeatable so you apply the model to the test set.

JMP Pro is a huge breakthrough in simplifying the process. The first enhancement introduced is a much easier way of generating a validation column. From JMP, choose Cols -> New Column, Initialize Data -> Random -> Random Indicator. Random Indicator column will default to values 0 (Training) , 1 (Validation) and 2 (Test). You can now choose what portion of the data you want to use for each step.

Validation Column Generation

Train, validation and test set generation

Most of the modeling platforms in JMP Pro now have a option to input a validation column. This allows you to complete the long process of building, tuning and testing your models, as I just described above, in one easy step. As you're inputting your variables, choose your newly made column as the validation option.

JMP Pro Model Validation

Validation column in JMP Pro

One fact of statistics is that not all modeling techniques work well for all data sets. Each technique has its strengths and weaknesses; each one can teach you something different about your data. One strength of JMP Pro is that it offers multiple modeling techniques under one roof. You can try each algorithm, evaluate its performance and even save the model (prediction formula) to the data table as a new column. JMP Pro Version 10 now allows you to compare your models once they've been built.

Compare your models

Compare multiple models

Run the Model Comparison platform and choose the models you want to compare (or let JMP choose them).

Compare Multiple Statistical Models

Model Comparison in JMP Pro

In this example, the Bootstrap Forest seems to have generated the best model. If multiple models have similar statistics, another method to view the models is to use the interactive Profiler platform. It not only allows you to develop an intuitive understanding of how the model works, but it also shows how varying multiple inputs can affect the output. You can download the data I used in this blog post  from the JMP File Exchange and try it out yourself! (Note: Download requires a free SAS profile.)

Post a Comment

The beauty of diversity in analytics

I recently gave a short talk at Predictive Analytics World in DC called “Analytics: The Beauty of Diversity.” Having just met with a wonderful group of customers a few weeks ago on the JMP Customer Advisory Board, I noticed that some of the same themes appeared: diversity of perspectives and how that fuels innovation, the need for multiple paradigms, and the importance of visualization — both data visualization for exploration and analysis, as well as information visualization for sharing results.

Analytics is cross-disciplinary, so it reflects a rich diversity of perspectives — statistics (composed of many subdisciplines itself), measurement theory, econometrics, psychometrics, operations research and many more disciplines. Whole new fields have formed — some from a few decades ago like behavioral economics and behavioral finance to, more recently, network science and econophysics. Network science I had heard of, but econophysics is one I just came across in Everything Is Obvious Once You Know the Answer by Duncan Watts (very enjoyable book).

Back to diversity. The customers on our advisory board have diverse backgrounds and areas of expertise—as we would expect among users of a product that has evolved over more than two decades. While they love JMP, JMP alone didn’t meet all their needs (what product does? And please don’t say spreadsheets!). Two of my favorite quotes from the board meetings: “JMP helps you think in data” and “The learning curve is shockingly fast.” JMP allows them to do a great deal; it also allows them to call out to SAS, R and other tools based on their needs and skills.

Many are still unaware that JMP is a full SAS client, enabling you to do amazing things with the vast and highly scalable data manipulation and analysis capabilities SAS has. Many are also still unaware that JMP allows you to call out to R.

To help get the word out, I’d like to give a plug for an upcoming workshop JMP is sponsoring at Predictive Analytics World in Chicago on June 24: JMP, R, and SAS: The Beauty of Multiple Paradigms. Matt Flynn, who will be conducting this workshop, has given some interesting talks on this topic resulting in some very helpful resources:

At Predictive Analytics World in New York last October, Matt presented Creating More Analytical Bandwidth with R. Following that, Matt gave a talk on Finite Mixtures Using JMP, SAS and R Together at SAS’ Analytics 2011 in Orlando last October. He gave similar talks at The 46th Actuarial Research Conference and more recently at Insurance and Financial SAS User Group (IFSUG). Other useful things he’s contributed include:

Similar resources can be found on the JMP File Exchange (new files are added all the time, so check back often). You might also want to view these demos:

We hope you will take advantage of these resources to create more analytic bandwidth yourself.

Post a Comment

Google Docs and the JMP Graph Builder for iPad

Have you had a chance to download the JMP Graph Builder for iPad? If you haven't, go to the AppStore and download it. It's free and a great tool for data visualization and exploration, and it's the best way to view and explore JMP 10 data tables right on your iPad.

In a previous post, blogger Michael Hecht talked about getting data to the iPad and described methods using iTunes, Mail and embedding a JMP data table on a Web page. And now with the latest version of the JMP Graph Builder, Dropbox support is fully integrated.

I have one other way of getting data to the iPad that even lets you share data with groups of people, or publicly, without needing your own website to host files: Google Docs.

Google Docs provides an option for storing JMP tables online, controlling who has access to those data tables, and creating a convenient data catalog that is accessible from your iPad anytime you have access to the Internet.

In Google Docs, there is a small drive icon with an up arrow on it. If you hover over that, you have the option to upload files.

Now select the JMP data table that you'd like to upload.

You will want to make sure that you uncheck that option to convert the file to Google Docs format. This will keep the .jmp file format intact.

When the upload is complete, you will have your JMP file available in your Google Docs directory. If you navigate to the corresponding Google Docs mobile page on your iPad, you will be greeted with the file that you just uploaded on your desktop computer.

To open this in the JMP Graph Builder app, simply click on the file name. The file will be recognized as being able to be opened in JMP Graph Builder automatically.

And there we are! From desktop to iPad quickly and easily through Google Docs. Now the trick here is that you can take this one step further. Google Docs offers the ability to change the permissions of any file uploaded. Normally, only you can see the files you've uploaded to your Google Docs account, but if you edit the sharing settings of any file, you have the option to share the file with anyone (anyone who can find and access the file), anyone who has a link to the file, or only specific people explicitly granted permission. This flexible permission structure, combined with the library-like nature of Google Docs, makes this way of getting data into Graph Builder on the iPad quite powerful.

Before you know it, you can have an entire library of JMP data sets available to access and share, and with 5 GB of available storage for free, you won't soon grow out of room as your online data library expands. With a little creativity, you can start brainstorming the powerful use cases for this workflow and sharing ability:

  • Generate a set of data visualization scripts in Graph Builder on desktop JMP, upload to Google Docs, and email each member of your team so they can explore the data visually on their iPads along with you at an upcoming meeting -- instead of staring at static screenshots or presentation slides.
  • Create an online library of JMP data tables from all of your active projects. Easily access those files anytime you need them, without having to drag your laptop around.
  • For educators: Upload a set of files once to your Google Docs account and then share links to all pertinent examples from the day's lecture with your students without the need to email attachments. Students can follow along visually as you explain concepts.

Post a Comment

Visualization of Google Code Jam participation

I've always enjoyed programming contests. I was a regular contestant and sometimes winner in MacTech magazine's Programmer's Challenge in the '90s where the fastest code wins, and I've been a longtime participant and now part-time administrator at Project Euler, where only correctness matters. For the past couple years, I've been trying Google's Code Jam, which is a live competition where you have 2.5 hours to solve several problems. This past weekend, I participated in Round 1, which reduced 15,692 qualifiers down to 3,000 for Round 2.

To accommodate entrants around the world, Round 1 is held at three different times, which gives participants multiple chances to advance and at least one chance in a locally friendly time slot. The website go-hero.net aggregates some of the participant data by country and programming language, and I decided to look at it in JMP to see how country participation matched the time of the contest.

Using JMP Graph Builder to see country participation by time: The US is colored dark red in Round 1A because that's when most US contestants took part in Google Code Jam's first round.

The dark shading shows my interpretation of where the local start time was non-friendly (9 pm-9 am). As expected, most of the higher participation occurs when the starting time is friendly. Russia is a noticeable exception, but I imagine that's only because the country spans so many time zones and most of the population is in the west. Uruguay also looks to have an higher percent of off-time participants, but there were only six total Uruguayans in the contest, so more variation is expected. Finer grained location data would avoid the Russia problem and would allow East Coast/West Coast distinctions in the United States.

How was the graph made? Getting the data into JMP was easy, thanks to File > Internet Open. I then used formula columns to convert the counts to percents within country to see how each country's entrants were distributed over the three times. And I stacked the Round columns so I could use Roundas a grouping variable.

You can download my JMP file from the File Exchange. (You'll need a free SAS profile to download.)

Getting a basic colored map in Graph Builder is as easy as drag and drop, but it took a few more steps of tuning to get it into presentation form. My additional steps:

  • Changed the color scale to a two-color scheme instead of the default three-color scheme since there is no meaningful middle value.
  • Added a background map for better context.
  • In properties, turned on Show Missing Shapes, to see the non-participating countries, too.
  • In Customize, turned off the country outlines and set the missing shape color to white.
  • Edited the graph and legend title.
  • Added a graph script to each panel to shade the areas with non-friendly local start times as dark.

By the way, I did make it to the next round, but only after getting up at 5 am on Sunday for the final chance.

Post a Comment

Supervised binning add-in for predictive modeling

When building a prediction model, there are a variety of ways that we can model the response as a function of our predictors. The Fit Model platform in JMP allows us to model the response as a linear function of our predictors. The Nonlinear platform allows us to model the response as a nonlinear function of the predictors, maybe in the form of an exponential or sigmoidal curve. Another option is to model the response as a step-function of our continuous predictors. We can build this kind of model by discretizing, or binning, our continuous columns. This blog post provides a brief description of the “Supervised Binning” add-in for building this type of model. Here “supervised” refers to the fact that we are using the response variable to help us choose the best binning scheme. The add-in is available for download from the JMP File Exchange as part of the “Predictor Binning” add-in (download requires a free SAS profile).

As an example, the Corn data table in JMP’s sample data folder provides corn yield measurements and the concentration of nitrate added to the soil. Plotting these data, we see that the relationship between the two variables is highly nonlinear, and we realize that it might be difficult to determine a model that would be appropriate for the data. So it would be interesting to bin the nitrate values, creating a step-function to predict corn yield. To do this, we simply launch the Supervised Binning add-in and specify the “yield” column as the Response and the “nitrate” column as the Explanatory Variable.

Example dialog for the Corn data

The add-in appends a binned version of the nitrate column to the original data table. This new column, “nitrate binned,” is a four-level categorical column where each level represents a different range of nitrate values. For example, the first bin represents the observations where the nitrate level is less than or equal to 10.58. Now we can use the binned column (in either the Fit Model or Fit Y by X platform) to predict yield. The figure below compares the binned prediction function to a disjoint quadratic model for predicting yield. The binned model is easier to interpret than the nonlinear model, and it has a lower mean-square error.

Fitted models for the Corn data

The corn example is nice for looking at how predictor binning works for a simple example, but binning is also very useful when building more complicated models. For example, we could look at the Boston Housing data from the JMP sample data folder. Here we are trying to predict median home values using a variety of features of each town. Suppose we want to use all of the data available to build a linear model, but we have reason to believe that several of the predictors have a nonlinear relationship with home value. For example, maybe we believe that home values are relatively constant for low crime rates, but drop dramatically above a certain crime rate.  We could make similar arguments to justify binning the “rooms” column. We can use the Supervised Binning add-in to bin the “crim” and “rooms” columns, as well as any other columns that might seem appropriate.

Binnned model for the Boston Housing data

The add-in breaks the “crim” column down into 10 discrete categories. Once the per capita crime rate goes above 2.0, home values start to drop quickly. Now we can use a combination of our binned columns and the remaining continuous columns to build a model with potentially (hopefully!) much better predictive ability than a model built with the original columns.

So if you have ever found yourself wanting to bin or discretize your continuous predictors, you might want to try out the Supervised Binning add-in. You can find this add-in as part of the Predictor Binning add-in on the JMP File Exchange.

Post a Comment

JMP Discovery Summit registration open

Discovery Summit 2012 will take place September 10-13 in the Executive Briefing Center located in the LEED Platinum-certified Building C on SAS world headquarters’ picturesque campus.

Reserve your place at Discovery Summit 2012, hosted by JMP. It’s the analytics event of the year, an interactive forum where theories will be challenged, best practices benchmarked and innovative concepts born. This year it’s taking place in the brand new Executive Briefing Center at SAS world headquarters in Cary, NC, Sept. 10-13. Many call Discovery Summit “the best conference I’ve ever attended.”  But it’s not for everyone.

Discovery Summit is for you if you want to:

  • Explore broad analytic ideas with world-renowned authorities in statistics, technology and innovation.
  • Participate in one-on-one conversations with JMP developers and users from all industries.
  • Learn first-rate statistical techniques.
  • Find inspiration for interacting with your data to see patterns and trends.
  • Make analytics your framework for decision making, rather than an afterthought.
  • Add value to your organization by implementing strategy more efficiently.

Does this sound like you? Then join the best of the best at Discovery Summit 2012.

Visit the website to learn more about pricing and discounts and to register.

Post a Comment

Business case studies that teach statistics

JMP users may remember UC Denver Professor Marlene Smith for the lively discussion around the poster she presented at JMP Discovery Summit last year: Using JMP to Teach Business Statistics: Cases and Applications.

Now you can access 12 of her business case studies. Professor Smith includes a description of each business problem, a complete illustration of how to use JMP to analyze the problem, a summary of statistical insights gained through analysis, possible managerial implications and the JMP data tables.

The cases provide tools for analyzing and understanding:

  • Medical malpractice claim costs
  • Airline baggage complaints
  • Impact of sampling plans on incidence of manufacturing defects
  • Survey data about a summer film series
  • Price quote consistency
  • Impact of changes in treatment facility on patient and employee behavior
  • Impact of task prioritization on product delivery
  • Annual fund-raising contributions
  • Impact of direct mail campaigns
  • Forecasting market share
  • Factors impacting cell phone service performance
  • Conditions contributing to lost sales

I spoke with Professor Smith about her passion for using business case studies.

Q: What are case studies?

A: Case studies start with questions or problems that business decision-makers working in the business world – the world our students are entering – will have to solve. Cases include sample data that students can use to try to solve the problem. Notice I use plurals for the people doing the work – decision-makers, students. Case studies are often used by teams so that the students can bring their different skill sets to the table, share the work and be able to defend their results to the variety of people involved in work decisions.

Q: Why use the case study approach?

A: Statistics are very important for business, but let’s face it, stats can be dry and appear irrelevant to students wanting to make their mark in the business world. Case studies offer a two-pronged approach that helps students learn and appreciate statistics. First, I start with business problems that students will likely find in the workplace – problems that interest them and will require statistical analysis. Second, I give them the real data and tools to let them dive into hands-on analysis. The inquiry into statistics will follow – sort of "if you build it, they will come."

Q: Do you use case studies in all your courses?

A: I use them where appropriate to the course goals. They are particularly effective in my Introduction to Statistics course for MBAs. That course is offered on campus and online. The students can schedule face-to-face or online group time to collaborate.

Q: Do you plan more case studies using JMP?

A: I'm working with Mia Stephens, from the JMP team at SAS, to develop a few more on multiple regression and data mining.

If you are interested in checking out a recent paper (August 2011) by Professor Smith published in The American Statistician, you can read the full text of Missteps in Multiple Regression Student Projects: Beyond Association-Not-Causation.

More resources for learning JMP

For more teaching tools, try out JMP Tutorials for Statistics 201: Introduction to Statistics prepared by the Department of Statistics, Operations and Management Science at the University of Tennessee and Florida State University statistics instructional videos on topics typically covered in Introductory Statistics courses. For more information, explore the JMP Academic area.

Post a Comment

Predictive modelling captures imagination of analytical community in UK

We are holding a seminar on how to build better statistical models on Thursday 10 May, and the number of people who have registered is unprecedented. More than 100 people are planning to attend from a vast array of analytical functions, including banking and insurance, R&D and manufacturing, marketing and services.

So what has inspired them to come and listen to us for the day?

The attraction appears to be the coupling of a broad range of sophisticated predictive modelling techniques within a world-class visualisation environment, which allows them to explore, model and understand their data, so that they can learn quicker and make better decisions more easily using JMP Pro. Some of the techniques that we will be showing live are those that are most widely used for predictive modelling such as:

  • Decision trees
  • Random forests
  • Regression
  • Neural nets
  • Model boosting
  • "Hold back" validation

To find out more about the four scenarios that we will be showing on the day, you can visit seminar page.

Post a Comment

Solving a problem with the JSL Debugger

The following is a case study of using the JSL Debugger to solve a problem. This is based on a real script with the problem specified. If you would like to see the problem in context, I created a script – much simplified from the original – that shows the problem. If you’d like to “play along,” you can download DebuggerDemo-SolvingProblems.jsl from the JMP File Exchange (free SAS profile required for download).

Although I’m describing the original script, the code snippets and the pictures are all from this sample script. Follow along!

The Problem

The other day, a JSL scripter who had a problem with a script was directed to me for help. Her script ran fine in English, but a tester running her script in Simplified Chinese got errors.

The problem seemed to be with the way strings were being handled in English versus Chinese: Specifically, escaped quotes (\!") were being left out.

In English, here is a sample string that was constructed:

"dt<<Select Where(dt:Numbers == 45 & dt:Pick Strings == \!"South\!")"

In Chinese, the string looked like this:

"dt<<Select Where(dt:Numbers == 45 & dt:Pick Strings == South)"

Note the missing \!"...\!" around South, which caused errors when the string was parsed and that unquoted value couldn’t be resolved.

Was there was a bug in JMP when handling quotes within strings in languages other than English?

First Look

She sent me the script and the data needed to run it. The script was just short of 900 lines and produced an interactive report. The first 130 lines were setup, lines 131-886 defined expressions, and then the rest of the script used those expressions.

The first thing I did was run the script in English and then in Chinese, to see if I had the same problem. I did. Then I ran it in French, which confirmed that the problem was with any non-English language, not just Chinese. I ran the rest of my tests in English and French, because French is easier for me to read than Chinese.

TIP: It's easy to switch the language you're running JMP in on Windows. Select File > Preferences, and select the Windows Specific category. At the top, select a language under Display Language. On Macintosh, quit JMP first, and then open System Preferences (on the Apple menu), and select the Language & Text category. Drag a new language to the top of the list. Don't close this window! It sets the language for your computer. Start JMP, and it will run in the first language in the the list. When you're finished, quit JMP and drag English (or whatever language you typically use on your computer) to the top. Now it's safe to close the System Preferences window.

There were several lines that constructed the string above, and they all relied on fairly complex coding that would have been hard and time-consuming to execute line-by-line, entering and exiting multiple expressions, and understanding what I was looking at.

Running just the appropriate string-building lines (after the script had been run once to initialize all those variables) gave the same results in all languages, with the escaped quotes being used correctly. However, the lines that formed the string used values from two data tables plus a third that was constructed from the first two, and it was very hard to tell at a glance where all the variables being used were created and populated.

In other words, this was a job for the JSL Debugger!

Enter the JSL Debugger

Running JMP in English, I opened the script and clicked Debug. Since I’d already run the script, all its variables were listed under Globals. And there were a lot of them – too many to track as I moved through the script. (I could also have discovered this by running Show Globals() and watching the log grow very long.)

That was all I needed to know right then, so I quit the JSL Debugger and quit and restarted JMP so that my environment was now completely clean. I opened the script, and started the debugger again.

I was interested only in the string that was being built, so I added that variable to my Watch list. To do so, I selected the variable in the script as shown in the JSL Debugger, right-clicked and selected Add Watch.

Select and add a Watch Variable

Select a variable, right-click, and select Add Watch to add a variable to the Watch list.

I added a breakpoint on the first line after the setup portion was finished (Line 131 in the original; Line 34 in my sample), and another one at the first “real” instruction line after all the expressions were created (Line 887 in the original; this doesn’t exist in my sample). To do so, I clicked next to the line number in the script shown in the debugger.

Set a Breakpoint

Click in the line number margin to add a breakpoint at the line.

TIP: A breakpoint will only work if you place it at a line that performs some action. A breakpoint at a blank line, a line that only contains a closed parenthesis, or a line that's commented out will be ignored.

I ran the first “setup” portion and saw that my string variable had not yet been created. I learned that with one click – much faster than I would have running the script manually line by line!

I ran the second portion, which simply created all the expressions.

Now it was time for action.

The “meat” of the script was contained at the bottom of the original script, in only 10 lines. The first part was a loop that called a couple of expressions (which called expressions, which called expressions, etc.). I used the Step Into button to step into each expression, to find out what was happening.

TIP: Using Step Over when an expression, user-defined function, or Include() are called, runs that code in its entirety, returns its result, and places the point of execution at the next line. If you don't need to step through line-by-line, this is a fast way of skipping what you don't need. On the other hand, sometimes you do need to see exactly what that expression, function, or included script is doing. Use Step Into instead, and you will be able step through that piece of code line-by-line.

Results

What I discovered was that each piece of the string was built within an If() expression: If the column with the information was character, then the value was quoted with the escaped quotes; otherwise, the value was not quoted.

This also meant that, out of almost-900 lines of code, I was really only interested in a small chunk of 19 lines (which nevertheless depended on the other 800+). These lines are re-created (and simplified) in Lines 38 – 54 in my sample.

I changed JMP to run in French, quit and restarted, and went through the debugger again.

Suddenly, all was all clear...

JMP is Localized! (Who Knew?)

The problem was not with the assignments that built the string. The problem I saw immediately with the debugger is that in French, the condition within the If() expression that determined if the column was character determined that the column was not character. For character columns, the script executed a different code point in French than it did in English.

In fact, the condition in French would always return 0. The condition piece of the If() expression is this (Lines 40 and 48 in my sample):

Parse( "dt:" || ColumnNames[thisCol] ) << Get Data Type() == "Character"

In English, col<<Get Data Type() returns "Character" for a character column. In French, it returns "Caractère", which will never evaluate to being equal to "Character".

col<<Get Data Type() always returns a localized answer.

Since the column in question was never determined to be equal to "Character" when run in Chinese (or French or any language other than English that JMP supports), the string was constructed as if the cell value was numeric. And that was why the string in English had escaped quotes and the string in Chinese didn’t.

Note: Although the JSL Debugger doesn’t show the results of the <<Get Data Type() message – only the result of the comparison – I could easily quit the debugger, and select and run Parse( "dt:" || ColumnNames[thisCol] ) << Get Data Type() to see what was actually returned. The debugger allowed me to find the problem quickly and painlessly.

Call to Action

There is no bug in JMP: This is working as designed. The script needs only a small change to work in any language.

There is more than one approach to make the script friendly across languages. What would you do? I’ll add the approach we took to the comments in a week or two.

Post a Comment