Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Num# or another function

Hi guys,

I have a field wich tells us the % of click share. My problem is that when it is less than 10% it shows "<10%". In other cases it shows "x%" (for example, "70%")

What I want to do, is to loose the percentaje symbol and in case it hase one the "<".

Can you tell me a way to do this? i heard about the Num# function but i really don't understand it. If you guys could help me with this, or another function I appreciate it.

Thanks!

Nico

10 Replies
Digvijay_Singh

Is it a numeric calculated field or directly read from source? can you share some sample values as well

sunny_talwar

May be this

Num#(KeepChar(FieldName, '0123456789')) as FieldName

Anonymous
Not applicable
Author

try num#('###########.###%;<###########.###%')

--> this will set the numerical value, If you like you can set the formating with num, for example:

num(num#('###########.###%;<###########.###%'))

Not applicable
Author

its read from the source. I get a field wich may content a percentaje number (like "70%", or "39,9%"), "<10%" or "--" in case it has no clicks

Not applicable
Author

Robin thanks for the response!

what does all the ###### represent?

Could you explain me how the function works?

Nico

Anonymous
Not applicable
Author

It's a number consisting of maximal 14 digits, the negative sign is "<" and everything is in percent...

Do you know the basics? , the difference between num#() and num()?

Not applicable
Author

Great Sunny!! I used this and worked!!

Thanks a lot.

Nico

sunny_talwar

If you have decimal percentages, then I would modify this a little (added a decimal after 9 in the script below)

Num#(KeepChar(FieldName, '0123456789.')) as FieldName

Not applicable
Author

Yes! I saw that, and did it!!

Thanks for your magic