Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to change series data for one CDE component

  1. #1
    Join Date
    Apr 2013
    Posts
    1

    Default How to change series data for one CDE component

    Hi, I work in a big government DW project and have a very detail-specific set of customized reports. I have a CDE report with 6 components (bar charts and dot charts) and need to change the series data for some of the charts. I'm using this SELECT to make tests, is works on Pentaho's built-in SampleData:

    SELECT CUSTOMERNAME, 1000 * SUM(ORDERFACT.TOTALPRICE) / (SELECT SUM(ORDERFACT.TOTALPRICE) FROM ORDERFACT WHERE YEAR_ID = 2004) AS REVENUE_PCT
    FROM ORDERFACT INNER JOIN CUSTOMERS ON CUSTOMERS.CUSTOMERNUMBER = ORDERFACT.CUSTOMERNUMBER
    WHERE YEAR_ID = 2004
    GROUP BY CUSTOMERNAME
    ORDER BY REVENUE_PCT DESC limit 50


    I need to change the returned data like this:

    • if REVENUE_PCT > 25, multiply it by 1.33
    • if REVENUE_PCT <= 10, multiply it by 0.5



    Can't change the SQL because the results are used in other charts. I must send just one SQL query to the production database (these are heavy queries), so can't create another datasource.

    How can I do this?

    Thanks
    Rafael


    EDIT:
    • CDE Version 13.06.05 (stable)
    • CDA Version 13.06.05 (stable)
    • CDF Version 13.06.05 (stable)
    Last edited by rafaelfd; 08-22-2013 at 03:36 PM.

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    hello.

    You can use the postFetch function for the component where you want to change the data. The postFetch receives as argument the dataset. You can then manipulate it and change whatever you need. At the end of the function, return the changed dataset.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

Tags for this Thread

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.