Giter VIP home page Giter VIP logo

active_olap's People

Contributors

wvanbergen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

active_olap's Issues

Not handling date_trends and time dimension when there is no data.

When a date trend or time dimension is used and there is no data you get and sql error.
Line 65 of dimension.rb:
"CASE #{whens.join(' ')} ELSE NULL END AS #{@klass.connection.send(:quote_column_name, variable_name)}";

returns:
CASE ELSE NULL END AS "dimension_0"

Which is invalid. Might want to add a check for the "whens" variable on like 64.

Not handling ambiguous column names correctly with :joins

If you run an olap query with a :joins, the 'id' column will be considered ambiguous. You need to prepend the table name to the front of the column for each dimension. In dimension.rb, line 58, add the @klass.connection.send(:quote_table_name, @klass.table_name) + '.' + to the beginning of the column name:

def to_case_expression(variable_name)
  if @category_field
    @klass.connection.send(:quote_table_name, @klass.table_name) + '.' + 
      "#{@klass.connection.send(:quote_column_name, @category_field)} AS #{@klass.connection.send(:quote_column_name, variable_name)}"
  else
    whens = @categories.map { |category| @klass.send(:sanitize_sql, ["WHEN (#{category.to_sanitized_sql}) THEN ?", category.label.to_s]) }
    "CASE #{whens.join(' ')} ELSE NULL END AS #{@klass.connection.send(:quote_column_name, variable_name)}";
  end
end

You'll probably want to implement a more robust solution though.

Exception on simple model

Hey Willem,

tried to use your plugin, but when doing on a simple model Ping, it raised an exception on

Ping.olap_drilldown(:created_daily => :period_1)

ActiveRecord::StatementInvalid: Mysql::Error: Unknown column '' in 'where clause': SELECT pings.* FROM pings WHERE (((>= '2009-11-22 00:00:00' AND < '2009-11-23 00:00:00') AND ((>= '2009-11-21 00:00:00' AND < '2009-12-05 00:00:00'))))

enable_active_olap do |olap|
# Easily create a trend dimension
olap.dimension :created_daily, :trend => {
:timestamp_field => :created_at,
:period_length => 1.day,
:period_count => 20
}
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.