BookmarkSubscribe
Choose Language Hide Translation Bar

Multiplying values in a column.

I have a table as below.Need to find product of rows in each column to find the area of the rectangle.How can I do this?

 Shape Rect1 Rect2 Rect3 Length 5 10 15 Breadth 2 8 6 Area
2 REPLIES 2
Highlighted

Re: Multiplying values in a column.

dt = current data table();

dt:Rect1 = dt:Rect1 * dt:Rect1;
dt:Rect2 = dt:Rect2 * dt:Rect2;
dt:Rect3 = dt:Rect3 * dt:Rect3;
Jim  Jeff_Perkinson Community Manager

Re: Multiplying values in a column.

@txnelson has shown you a response that will give you exactly what you've asked for.

However, I'm curious exactly what you're trying to do? Using a JMP data table like a spreadsheet is like using a wrench as a hammer; it will drive some nails but you're likely to skin your knuckles.

A JMP data table is a more structured format than a spreadsheet. You'd be well advised to use it for what it's good for. In general, each row of a data table should represent a unique entity, similar to every other row, and each column should represent a single kind of measure on each of those entities.

In your example, take the data table you describe: and recognize that you've got your entities (Rectangles) in the columns and your measures (Length, Breadth, Area) in the rows.

If that's the way the data was handed to you, no problem. Just reshape it using Tables->Transpose and you end up with this. Notice now you have one row for each Rectangle and one column for each measure. Now you can use the Formula Editor to multiply the Length and Breadth to compute the Area. I hope that helps explain a bit about why it wasn't obvious how to multiply rows. Math across rows doesn't make sense for a JMP data table. After all, what would Distribution mean on data in that format? -Jeff