Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

rql_example.rb:

Code Block
languageruby
activities = (ranks = ((data.group_by :project, :issuetype, lambda {|r| Date.parse(r.created).quarter} => :quarter)
  .select :project, :issuetype, :quarter,
      lambda {|group| group.size} => :items)
      .where_ranked :issuetype, :items, 5).indexed_on [:project, :quarter, :issuetype] 

periods = data.group_by :project, :issuetype, lambda {|row| Date.parse(row.created).quarter} => :period

rows = (periods.group_by :project, :issuetype => :type, :period => :period, lambda {|group| group.size} => :total)
  .select :project, :period, :type,
      lambda {|group| 
        row = activities.join group, [:project, :period, :type]
        row.items unless row.nil? } => :items,
      :total => :total

...