Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
becki_kain
Contributor III
Contributor III

num not working as expected

if I do this:

num((sum({1<[TP]={$(TP1)}, VEH_TYPE -= {'Unk'}, Segment -= {'Unk'}, Segment2={'Full-Size Pickup - O8500','Full-Size Pickup - U8500'}>}Volume)/$(total_sales_vol_tp1))*100,.1)

I get a bizarre result of 101

but if I do this (replacing num with round, nothing else changed):

round((sum({1<[TP]={$(TP1)}, VEH_TYPE -= {'Unk'}, Segment -= {'Unk'}, Segment2={'Full-Size Pickup - O8500','Full-Size Pickup - U8500'}>}Volume)/$(total_sales_vol_tp1))*100,.1)

I get 10.3, which is correct and is also the correct answer for the num command.  i use the exact same num command in another pivot chart, same project, and it's fine.  is this a bug?

thanks

becki kain

1 Solution

Accepted Solutions
MK9885
Master II
Master II

Maybe try

num((sum({1<[TP]={$(TP1)}, VEH_TYPE -= {'Unk'}, Segment -= {'Unk'}, Segment2={'Full-Size Pickup - O8500','Full-Size Pickup - U8500'}>}Volume)/$(total_sales_vol_tp1))*100,.1,'##,##0')

View solution in original post

5 Replies
MK9885
Master II
Master II

Maybe try

num((sum({1<[TP]={$(TP1)}, VEH_TYPE -= {'Unk'}, Segment -= {'Unk'}, Segment2={'Full-Size Pickup - O8500','Full-Size Pickup - U8500'}>}Volume)/$(total_sales_vol_tp1))*100,.1,'##,##0')

becki_kain
Contributor III
Contributor III
Author

close, I just remembered I have to, for each expression, do this for number formatting:

#.#;(#.#)

I can't seem to do it globally for the document and why does not having that in make qlik give me completely the wrong number?

becki_kain
Contributor III
Contributor III
Author

also, i have that in my document settings and yet i have to set it manually, for each expression. is that a bug?

MK9885
Master II
Master II

What do you have in document settings?

The Number tab where you can set fields to Number?

If yes, then that would only set the Fields or Variables to number and has to be done manually I guess.

Where as here you are writing a Set expression and expect an output result to be in particular format which has to be done manually.

Not sure if that's what your question was?

becki_kain
Contributor III
Contributor III
Author

yes, I was hoping to set all "numbers" to a specific format, by setting it in document properties, but that does not do that.  i'm not certain what it does.  does anyone know?