Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Conditional formating on wizard aggregation value

  1. #1
    Join Date
    Dec 2005
    Posts
    531

    Default Conditional formating on wizard aggregation value

    Hi all,

    I would like to conditional format a number-field in the group footer that uses a data field and the wizard aggregation (sum in aggregation type of the number-field attributes). E.g. If the sum of variances is negative, then text color is red.

    But I can't find a way to do it using the formula on the text color attribute since I don't have a data field to use. If I choose the data field that I selected in the value attribute, it takes the last value of the filed and not the result of the aggregation. I don't want to create a new field with the sum either, since I used the wizard's aggregation function.

    Is there a way to achieve this?

  2. #2
    Join Date
    Oct 2008
    Posts
    124

    Default

    I don't see a way to access the wizard values, but you can work around this by replacing the wizard aggregation with a built-in aggregation function. For example, after defining a Sum Function (ie TotalGroupSumFunction1) then using a formula to set the text color is as simple as this ...

    set style->(text)->text-color = if([TotalGroupSumFunction1]< 0; "red";"black").

    Perhaps someone more familiar with the subject can give you better advice, but this workaround is accessible and effective.

  3. #3
    Join Date
    Dec 2005
    Posts
    531

    Default

    Hi angelfish,

    thanks for the reply. But that is exactly what I do not want to do, since I would have to recalculate something that has been already calculated or have to create functions for each field.

    I was wondering if it would be possible to have something like an [this-field.value] in the formula which actually returns thhe value that the field has after all computations like the wizard aggregations are done.

    Added advantage would be that you could use generic formulas that are not based on some data field but on the actual value that is displayed.

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    There is no such way to access the current value yet. Make a JIRA for it and we can add it in the future. But for now, you have to use a extra function.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Oct 2008
    Posts
    124

    Default

    I agree that it would be a nice addition, and even looked into the "[this-field.value]" construct you suggest before I responded the first time because it seems so logical. I see that Taqua has provided a definitive ruling, though, and if you submit a JIRA we will have one more good thing to look forward to in a future release.

  6. #6
    Join Date
    Dec 2005
    Posts
    531

    Default

    Done, here is the JIRA . Feel free to add a comment ot vote for it

    @Taqua: Thx for confirming, that this is not possible at the moment.

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.