Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: How to handle quotes in your column name

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 29, 2019 5:02 AM
(3012 views)

I have a column name Substance "x". I need to sum the column but I am having an issue with the quotes. How do I use the column x with the quotes? I have tried :substance \!"X\!". That does not work.

2 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Try :Name("substance \!"X\!""), or column(dt, "substance \!"X\!""), where dt points to your table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

This code will work. I've only included the first two columns you want to add.

```
dt = current data table();
for (i = 1, i <= nrows(dt), i++,
Column(dt, "Total Sum" )[i] = Column(dt, "Dimer [Cl5Si2-O-Si2Cl5]" )[i]
+ Column(dt, "Silicon Tetrachloride(SiCl4)" )[i];
);
```

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Try :Name("substance \!"X\!""), or column(dt, "substance \!"X\!""), where dt points to your table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

As @pmroz points out, the Name() function is used to handle names that have special characters in them.

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

Thank you. That worked.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

On the same subject. The compiler likes the syntax, but I am getting the following error.

My Code is:

Thank you in advance.

Wayne

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

This code will work. I've only included the first two columns you want to add.

```
dt = current data table();
for (i = 1, i <= nrows(dt), i++,
Column(dt, "Total Sum" )[i] = Column(dt, "Dimer [Cl5Si2-O-Si2Cl5]" )[i]
+ Column(dt, "Silicon Tetrachloride(SiCl4)" )[i];
);
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

I was missing [i] from one of my columns. After correcting it worked perfectly. Thank you so much for the help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to handle quotes in your column name

Or add empty square brackets after the Column() function if you want to use For Each Row() to iterate.

```
For Each Row( Column("Total Sum")[] = Column("Dimer [Cl5Si2-O-Si2Cl5]")[] + Column("Silicon Tetrachloride(SiCl4)")[] + Column("Trichlorosilane(SiHCl3)")[] + Column("Hexane")[] + Column("Hexachlorodisiloxane(Si2Cl6O)")[] + Column("Substance \!"X\!"")[] + Column("HCDS")[] + Column("Mixed Dimer [Cl5Si2-O-SiCl3]")[] + Column("OCTS")[]
+ Column("GC Column Product")[] );
```

Learn it once, use it forever!