Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist II
Specialist II

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
Highlighted

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
Highlighted

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.

Highlighted
Specialist II
Specialist II

Hello,

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

regards,

Highlighted
Specialist II
Specialist II

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))

Highlighted

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
Highlighted

This is your need?

Please check the attachment..

Sample is for different color appearance in text object

Highlighted
Specialist II
Specialist II

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

Highlighted
Specialist II
Specialist II

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

Highlighted

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