Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: Aggregate Table

  1. #1

    Arrow Aggregate Table

    Dear All,
    Please I am trying to load an aggregate table but having problem getting it right with Kettle. The SQL code works fine when I run it using MySQL browser.
    See the code which I am trying to implement:
    Code:
    INSERT INTO agg_Prod_BI(
    fact_count,
    quantity,
    test
    materialno,
    indexno,
    prodno,
    testerno,
    year,
    quarter,
    month,
    day_of_month,
    hour
    )
    SELECT
    COUNT(*) AS fact_count,
    SUM(BASE.quantity),
    SUM(BASE.test),
    MAT.materialno,
    MAT.indexno,
    PRO.prodno,
    EQU.testerno,
    DIM.year,
    DIM.quarter,
    DIM.month,
    DIM.day_of_month,
    DIM.hour
    FROM Prod_BI AS BASE, time AS DIM, material AS MAT, production AS PRO, equipment as EQU
    WHERE DIM.time_key = BASE.time_key 
    AND PRO.prod_key = BASE.prod_key 
    AND MAT.material_key = BASE.material_key 
    AND EQU.equipment_key = BASE.equipment_key
    GROUP BY
    MAT.materialno,
    MAT.indexno,
    PRO.prodno,
    EQU.testerno,
    DIM.year,
    DIM.quarter,
    DIM.month,
    DIM.day_of_month,
    DIM.hour;
    I am grateful for any useful suggestion. Attached is the transformation file.
    Thanks,
    Ejay
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.