Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How calculate in Text Object

Hi guys,

How is possible to simplify the expression in text object:

='Overall NPS= ' &Round (Count({<[Overall experience]={'9-10'}>}[Overall experience])/count(TOTAL [Overall experience])-Count({<[Overall experience]={'0-6'}>}[Overall experience])/

count(TOTAL [Overall experience]),0.001)*100 &' %'

Please see also attached imageCapture.JPG

Thank you,

17 Replies
MayilVahanan

HI

May be try like this

='Overall NPS = ' & (Round (Count({<[Overall experience]={'9-10'}>}[Overall experience])/count(TOTAL [Overall experience]),0.001) -

Round(Count({<[Overall experience]={'0-6'}>}[Overall experience])/

count(TOTAL [Overall experience]),0.001))*100

May be it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

Check with this

='Overall NPS= ' &Round ((Count({<[Overall experience]={'9-10'}>}[Overall experience])-Count({<[Overall experience]={'0-6'}>}[Overall experience]))/count(TOTAL [Overall experience]),0.001)*100 &' %'

Edit:

Also add Abs function for the subtraction section.

Anonymous
Not applicable
Author

Hello,

Thanks for replying. What's different in your expression?

regards,

Anonymous
Not applicable
Author

I want to add color condition to this expression.

if the result is less than 0, color red, else blue.

Do you know how to add?

If(...., rgb(red), rgb(blue))

MayilVahanan

HI

Are you want to add color in chart? or want to display the value in text box? or some other?

Add color in chart:

In expression tab, click '+' sign, add the expression in background color.

Like

if(Count({<[Overall experience]={'9-10'}>}[Overall experience])-Count({<[Overall experience]={'0-6'}>}[Overall experience]))/count(TOTAL [Overall experience]) < 0, red(), blue())

or

if(your expression < 0, red(), blue())

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

This is your need?

Please check the attachment..

Sample is for different color appearance in text object

Anonymous
Not applicable
Author

I miss something

='Overall NPS= ' &If((Round (Count({<[Overall experience]={'9-10'}>}[Overall experience])/count(TOTAL [Overall experience])-Count({<[Overall experience]={'0-6'}>}[Overall experience])/

count(TOTAL [Overall experience]),0.001)*100)<0,red(),blue()) &' %'

it looks like

Anonymous
Not applicable
Author

Nice idea. But I need to print it. Sometimes it doesn't match 2 text box in reporter.

CELAMBARASAN
Partner - Champion
Partner - Champion

But there is no other way to highlight only some part in text object in specific color.