Examples of SimpleColumn


Examples of com.google.visualization.datasource.query.SimpleColumn

    // select max(songs), min(songs), year, avg(songs), sum(sales)
    // group by year, band
    Query q = new Query();
    QueryGroup group = new QueryGroup();
    group.addColumn(new SimpleColumn("Year"));
    group.addColumn(new SimpleColumn("Band"));
    q.setGroup(group);
    QuerySelection selection = new QuerySelection();
    selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
        AggregationType.MAX));
    selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
        AggregationType.MIN));
    selection.addColumn(new SimpleColumn("Year"));
    selection.addColumn(new AggregationColumn(new SimpleColumn("Songs"),
        AggregationType.AVG));
    selection.addColumn(new AggregationColumn(new SimpleColumn("Sales"),
        AggregationType.SUM));
    q.setSelection(selection);
    q.validate();

    DataTable result = QueryEngine.executeQuery(q, res, ULocale.US);
View Full Code Here

Examples of com.google.visualization.datasource.query.SimpleColumn

    // select max(sales), year, min(sales), avg(fans)
    // group by year
    // pivot by band, songs
    Query q = new Query();
    QueryGroup group = new QueryGroup();
    group.addColumn(new SimpleColumn("Year"));
    q.setGroup(group);
    QueryPivot pivot = new QueryPivot();
    pivot.addColumn(new SimpleColumn("Band"));
    pivot.addColumn(new SimpleColumn("Songs"));
    q.setPivot(pivot);
    QuerySelection selection = new QuerySelection();
    selection.addColumn(new AggregationColumn(new SimpleColumn("Sales"),
        AggregationType.MAX));
    selection.addColumn(new SimpleColumn("Year"));
    selection.addColumn(new AggregationColumn(new SimpleColumn("Sales"),
        AggregationType.MIN));
    selection.addColumn(new AggregationColumn(new SimpleColumn("Fans"),
        AggregationType.AVG));
    q.setSelection(selection);
    q.validate();

    DataTable result = QueryEngine.executeQuery(q, res, ULocale.US);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.