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: 
Not applicable

Adding % symbol after calculated value in expression

Hi,

We have calculated value by using one IF expression lets say the valu is xyz and we just need to add '%'
symbol after that value like xyz% but when we try to use &'%' in then statement of IF condition it doesnt work. Kindly suggest alternatives.

9 Replies
juleshartley
Specialist
Specialist

Hi,

Are these numeric values? If so then you may need to convert to text in order to add % to some of them. Try this:

text(xyz) & '%'

juleshartley
Specialist
Specialist

PS: If they are numeric fields, then I'd always recommend handling the formatting in the front end and retaining the data as a decimal...

Not applicable
Author

yes value is numeric

juleshartley
Specialist
Specialist

So where are you doing this formatting? You should be able to use something like this in an expression:

If ([field]= 123, num([field], '##%'), num([field], '##'))

Not applicable
Author

Sorry but its not working, If I append this before the value its working, like

if ([field] = 123, '%'&(sum(amount)*100) , '')-- its working

but

if ([field] = 123, (sum(amount)*100) &'%', '') -- this is not working

MK_QSL
MVP
MVP

Try this ...

IF(field = 123, SUM(amount)*100) & '%'

Not applicable
Author

No I cant use this as I ma using big nested if

MK_QSL
MVP
MVP

Remove *100 from expression and use below...


NUM(    

     Your Big Expression i.e. Nested If

,'#,##0%')

christian77
Partner - Specialist
Partner - Specialist

Hi.

Formating it's only a view. It keeps numbers in memory as they are, but it represent them with a format.

The best thing to do about it is to copy formats from the tab Number in objects or in document properties.

formats.jpg

luck