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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

understanding the 'num#' function

Hi Guys,

I'm still a qlikview newbie, so please forgive me for my questions.

I don't know how the num# function works.

I have 2 fields which qlikview interpetes as text: Population and "% of world population"

China has a population of   1,339,724,852. How can I use the num# function to translate it to numbers. Does eachnumber represents a

'#' so I my case it would be #.###.###.###. I've tried that but that didn't work.

As far for % world population most countries have a population of 0,000000x%. '#,######%' that unfortunatelly not correct.

Can someone please explain how to use the num# function. I've read the Qlikview refference but didn't understand it.

What the difference between num and num#?

I don't want to change the SET settings, because I want to learn how the num# function works.

Please Help!!

Isam

14 Replies
swuehl
MVP
MVP

The second argument does not define the separators, that's what the third and fourth argument are for.

If you don't use the third / fourth argument, the standard separators set in the script / OS defaults are used.

So IMHO, there is no redundancy.

The number tab is used to override formats set on document level (for fields) or within the expression (for charts).

Not applicable
Author

Sorry, third and fourth argument.

OK, maybe redundancy is the wrong word, but it feels strange to allow this:

NUM(NumericValue, "#,###.", "t", "d")

I would say it's ambiguous, (which do I use, "," or "t"?)

But as long as there are clear rules about which thousands separator will be used, it's not ambiguous, it's just a matter of precedence/overriding behavior

It seems like Qlikview first looks in format string (second argument), then if no thousands separator found, would fall back on thousands separator (third argument). Or in other words, the format string takes precedence / overrides the thousand separator argument. Is that right?

And it sounds like the Number tab is also a matter of precedence.  Number tab overrides document level (field-level) formats (is that like the "Expression default"?) , or any formatting set directly with the expression itself (i.e. using the NUM function?)

Thanks    

vireshkolagimat
Creator III
Creator III

Hi,

I am trying to use the below formula but still negative numbers are not showing in brackets.

=num#(if(Desc=1,test,''),'#.0;(#.0)')

Let me know what is wrong in this formula.

Regards,

Viresh

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try using the num() function instead.

vireshkolagimat
Creator III
Creator III

I tried but it is not working.