Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

negative number in brackets

I have a text object that I wanna show as number with % and when it´s negative I wanna it in brackets.

It works if the result is +20.29%, but if the result is (8.85%) it shows (0.09%)

The expression is as below:

=num((

max(Aggr(

(sum({<[Reporting Calendar Year] = {'$(vCurrentYear)'}>} $(vCurrency)) - sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)))

/

sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)),

[Broker Pack Region]))

-

max(Aggr(

(sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)) - sum({<[Reporting Calendar Year] = {'$(vPriorYearBefore)'}>} $(vCurrency)))

/

sum({<[Reporting Calendar Year] = {'$(vPriorYearBefore)'}>} $(vCurrency)),

[Broker Pack Region])))*100

,'+ ###.##%;(###.##%);-')

Any idea what to do?

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Use

Num(YourExpression,'+ ###.##%;(###.##)%')

watch the place of the ) and %

View solution in original post

8 Replies
Anil_Babu_Samineni

As i got, If you got +ve value then 12.43%

Meantime, While selection if you got -Ve value then (-12.43%) -- Is this you are expecting? Or What

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rcandeo
Creator III
Creator III
Author

sorry not being more clear. With positive(+) value then works.With negative(-) values it is showing divided by 100, so when should see (12.43%) it shows (0.12%)

Anil_Babu_Samineni

It's tricky t explain, Can you post sample application which demonstrates the issue

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

How about this:

=Num((

max(Aggr(

(sum({<[Reporting Calendar Year] = {'$(vCurrentYear)'}>} $(vCurrency)) - sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)))

/

sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)),

[Broker Pack Region]))

-

max(Aggr(

(sum({<[Reporting Calendar Year] = {'$(vPriorYear)'}>} $(vCurrency)) - sum({<[Reporting Calendar Year] = {'$(vPriorYearBefore)'}>} $(vCurrency)))

/

sum({<[Reporting Calendar Year] = {'$(vPriorYearBefore)'}>} $(vCurrency)),

[Broker Pack Region])))*100

,'+###.##%;(###.##%)')

stigchel
Partner - Master
Partner - Master

Use

Num(YourExpression,'+ ###.##%;(###.##)%')

watch the place of the ) and %

rcandeo
Creator III
Creator III
Author

This works. Thank you so much

rcandeo
Creator III
Creator III
Author

thank you but didn´t work

rcandeo
Creator III
Creator III
Author

thank you. it´s solved