Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
christianjmz
Contributor II
Contributor II

Text Color Expression not working in totals of Straight Table

Hi everyone,

my first post/question here...

I have an issue with totals in a straight table. In the text color expression within my 'YoY' expression,yoy.JPG I have calculated colors based on threshold values (positive = green, 0 = black, negative = red) , expression here:

=If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) <0.005 and

($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) > -0.005, Black(),

If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) >0.005, Green(), LightRed()))

Until here, everything works fine, but the totals. They are not following the text color expression and text color of total is always red, no matter if it's a positive or zero number. I have "average" in Total Mode, because with Expression Total it just doesn't show any totals.

table.JPG totalmode.JPG

Any suggestion here?

Thanks

1 Solution

Accepted Solutions
hirenjadiya
Partner - Contributor III
Partner - Contributor III

Hi,

Try using Visual Cues Tab in Straight Table (ref. image attach)

OR

Custom Format Cell (ref. image attach)

View solution in original post

9 Replies
hirenjadiya
Partner - Contributor III
Partner - Contributor III

Hi,

Try using Visual Cues Tab in Straight Table (ref. image attach)

OR

Custom Format Cell (ref. image attach)

sinanozdemir
Specialist III
Specialist III

Hi,

If you want your totals to change, then you need to use Dimensionality() function. Where the Dimensionality() = 0 is the totals row.

Hope this helps.

rupamjyotidas
Specialist
Specialist

I would follow what Sinan has recommended, you need to use Dimensionality() function to get the color right for Total

christianjmz
Contributor II
Contributor II
Author

Hi @Sinan, thanks for the advice,

I'm not sure about how to use Dimensionality(), I've tried this but it's doing the same...

=If(Dimensionality()<>0,If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) <0.005 and

($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) > -0.005, Black(),

If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) >0.005, Green(), LightRed())),

If(Dimensionality()=0,If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) <0.005 and

($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) > -0.005, Black(),

If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) >0.005, Green(), LightRed()))))

Please, correct me if I'm wrong, thanks.

sinanozdemir
Specialist III
Specialist III

Try the below:

=If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) <0.005 and

($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) > -0.005, Black(),

If(($(vCSATAMS) - $(vDSATAMS))-($(vCSATL1AMS) - $(vDSATL1AMS)) >0.005 And Dimensionality()>=0, Green(), LightRed()))

Hope this works.

christianjmz
Contributor II
Contributor II
Author

Thanks Sinan, but still not working...

Actually, if I put only Dimensionality()=0, the color is only in totals, but still red.

table.JPG

Any other suggestion? 😕

christianjmz
Contributor II
Contributor II
Author

Visual cues did it!

I was trying to do it inside the expression, but this worked perfectly anyway.

Thanks Hiren!!

sinanozdemir
Specialist III
Specialist III

Can you post the app? or just a small portion of it at least? Well, if you want to color change to be all the expressions including the total row, then you use Dimensionality() >= 0. If you only want the total row to change, then Dimensionality() = 0.

A sample app would be helpful at this point.

Thanks

christianjmz
Contributor II
Contributor II
Author

Thanks for the help Sinan,

I'd tried with both (>=0 and =0) and total remains red.

I did it with visual cues as Hiren recommended. But I will try with dimensionality too and will let you know how it's going.

Thanks for the help