1

If in sybase - infomaker file - I don't have any groups but since I'm using this to build pages in my software I need to be able to sum values. See attached screenshot. Totals. I would like the totals to be unique (or grouped by the id_key value).

The sum functionality has the following abilities. As I found here: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc00045_0250/html/ddref/BFCDFAJD.htm

Sum ( column { FOR range { DISTINCT { expres1 {, expres2  {, ... } } } } } )

The code I have is: sum( adult + senior_student + child + other for page) but what I'd like to do is have it "for id_key" but it doesn't seem to like that

ekad
  • 14,436
  • 26
  • 44
  • 46
YelizavetaYR
  • 1,611
  • 6
  • 21
  • 37

1 Answers1

1

If the names of your columns correspond to the headers above the answer should be: (you need to account for Null fields too).

sum(((If(IsNull(adult), 0, adult))    +
(If(IsNull(senior_student), 0, senior_student))  +
(If(IsNull(child), 0,child)) +
(If(IsNull(other), 0,other)))                
for page distinct id_key)

to sum by object:

 (If(IsNull(adult), 0, adult)) + 
 (If(IsNull(senior_student), 0, senior_student)) + 
 (If(IsNull(child), 0,child)) + 
 (If(IsNull(other), 0,other))
Elizabeth
  • 719
  • 1
  • 14
  • 27
  • This works great inside infomaker itself - however when i take it out to the software the spacing appears (multiple lines per page) and it does the addition by page - grouping the two together. – YelizavetaYR Jan 21 '15 at 19:42