Sha256: 7857e5f371c672908b776bc9bdf32f43ee383c2b0cdb65df5042fc4311d56f14

Contents?: true

Size: 428 Bytes

Versions: 8

Compression:

Stored size: 428 Bytes

Contents

#!/usr/bin/env alf

# What is the sum of supplied quantities by supplier?
(summarize supplies, 
           [:sid],
           :total_qty => sum{ qty })

# Give the maximal supplied quantity by country, taking only into account
# suppliers that have a status greater than 10
(summarize \
  (join \
    (join (restrict suppliers, lambda{ status > 10 }), 
          supplies), 
    cities),
  [:country], 
  :maxqty => sum{ qty })

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alf-core-0.16.3 examples/operators/summarize.alf
alf-core-0.16.2 examples/operators/summarize.alf
alf-core-0.16.1 examples/operators/summarize.alf
alf-core-0.16.0 examples/operators/summarize.alf
alf-core-0.15.0 examples/operators/summarize.alf
alf-core-0.14.0 examples/operators/summarize.alf
alf-core-0.13.1 examples/operators/summarize.alf
alf-core-0.13.0 examples/operators/summarize.alf