Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Change font color for negative values

  1. #1
    Join Date
    Jul 2010
    Posts
    29

    Question Change font color for negative values

    Hi !
    I've made a report that give me some numbers in a table.
    I would want to put the negative numbers in red.

    First I would use the IF function, but it didn't work so, I tried to put manually an entire column in red, and, it didn't work too !

    I take the field in the "details" row, and in style, I change text-color with red.
    In the design mode I see the field in red, but when I launch the preview, the field is still black.

    Is that normal ? Maybe because i'm using the "pentaho template" ? Is there a way to override the color of a template ?

    Thanks !

  2. #2
    Join Date
    Jul 2010
    Posts
    29

    Default

    Don't tell me that is impossible, I'm sure a lot of users do it, if only someone would write here how to...

  3. #3
    Join Date
    Feb 2009
    Posts
    321

    Default

    hi.. use formula... try this
    =IF([field]<0; "red";"black")

  4. #4
    Join Date
    Jul 2010
    Posts
    29

    Default

    Thank youuuu it works
    I guess it's because I didn't put the color between quotes.

    And, I add a little question : I've some Sum at the end of each column, but, it takes the color of the last value of the column istead of apllying the color to its own value

    Eg : 2 4 -6 9 -12 total -3 OK, -3 is in red.

    Eg2 : 2 4 -12 -9 6 total : -9 but -9 is in black because the last number, 6, is positive so, is in black.

    Is there a special thing to do ?

    Thanks
    Last edited by X3n0n; 08-05-2010 at 03:52 AM.

  5. #5
    Join Date
    Feb 2009
    Posts
    321

    Default

    mmmmmmm how do you do this sum? use formula? use functions?

  6. #6
    Join Date
    Jul 2010
    Posts
    29

    Default

    I'm using sum (running) with the report wizard, to, the field in the table and the field for the sum have the same things in "field" attribute, the only difference is that the field in the table has the name "wizard::details-BC_blablablablabl" and the field for the sum has the aggregation-type "Sum (Running).

  7. #7
    Join Date
    Jul 2010
    Posts
    29

    Default

    Ok, I discovered that if I make a new open formula, =SUM([myfield]) it give me the last result in the column of the table, that explain why the total has the color of the last value.

    I've made a crappy workaround :

    Create a formula Sum (running), choose [myfield], reset on group name "mygroup", and then, apply the IF condition on the original total, but, puttin the field [ItemSumFunction] instead of [myfield].

    Don't know if I'm clear

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.