0

I am trying to select specific values from a column in JSL, but there is an issue. The column name is:

Sum(ow_blah) 

And I would like to: select where(Sum(ow_blah) == 0)

Unfortunately, the combination of the keyword Sum and parentheses have led to significant problems. And Aliasing is not allowed in select statements. How can I use the Sum function within a where clause?

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56

2 Answers2

0

Use HAVING after grouping, as in:

select id, sum(ow_blah)
  from my_table
  group by id
  having sum(ow_blah) = 0
The Impaler
  • 45,731
  • 9
  • 39
  • 76
  • Unfortunately that did not work either, the select keyword isn't recognized unless I specify: dt << select (id, sum(ow_blah) from tablename group by id having sum(ow_blah) = 0 .... and it must be all on one line or the keywords are not recognized. Sorry, never had this problem before – Chris Dodd Jul 27 '18 at 02:23
0

Since "sum" is a keyword, you need to explicitly let JMP know that you are selecting a column by the name Sum(ow_blah). So for that, use it as:

Column("Sum(Ow_blah)")
Syamanthaka
  • 1,227
  • 2
  • 15
  • 23