Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannaiogr
Creator II
Creator II

color part of expression?

Hi all 🙂

 

I have a measure like this

(num(count( distinct ID), '#.##0', ',', '.'))&' ('&(round(count(distinct ID)/count(TOTAL distinct ID),0.0001))*100 &'%'&')'

which prints e.g. :    48.000 (5,58%)

I was wondering, could I colour just the percentage part in this expression, like maybe 48.000 (5,58%) ? Or make it bold, or in italics, or some sort of visual formatting?

Thank you so much in advance!

Labels (3)
4 Replies
sandeep-singh
Creator II
Creator II

I don't think it's possible. You can add color on complete field or on the basis of expression, but not on a particular part of the field value. If you want, you can break number and percentage value into separate fields and then highlight the percentage field with color. 

Hania
Creator
Creator

Hi,

I think it is not possible to do this in single expression you have to split expression into two parts like ,

Here I divide into two KPI 

First KPI:  Write expression for your value 

Second KPI:  Write expression for your percentage  with if condition.

After that you need to set color for your percentage value .

 This is a snap of my sample data for your reference.

Hania_0-1680850897015.png

 

  

aveeeeeee7en
Specialist III
Specialist III

Hi @ioannaiogr 

What @Hania has suggested is absolutely right.

If you have to achieve this in a single expression than you've to some extensions for that.

But your current requirement can be fulfilled using KPI Chart in which you can color

1st & 2nd expressions as per your requirement.

Here is the snapshot:

aveeeeeee7en_0-1680853361682.png

 

Regards,

Av7eN

ioannaiogr
Creator II
Creator II
Author

Hello everyone!

Yes, I am aware of the above method, I was just wondering if there is a way to color part of a field expression. Always helpful though! Thank you!