Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

insert % number by script

Hello everyone,

I'm trying to figure out how to insert a number by scripts in% because if I enable the% value in the table, when I enter a number for example 3, the result is 300% and no 3%.

  The script that I am trying to do is:   num('','#,##0%') as input

But it is wrong. some help? thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

for now I solved it this way: I put in my input table values (eg 4), then in my table where I perform linear calculations I inserted num ([Column Name] / 100, '#, # 0%') and it works, i get 4,00%.

I'm still trying to enter the percentage value in the table, if I can not solve I maintain the solution I found

View solution in original post

9 Replies
Gysbert_Wassenaar

LOAD

     ...some fields...,

     num(MyPercentageField/100,'#,##0%') as MyPercentageField

FROM ....


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

does not work, I did: num (input / 100, '#, ## 0%') as input.

I also tried using 'input/100' and even with " "

Gysbert_Wassenaar

Then the field input does not contain numbers. Use the num# function to create numbers from the string values.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

still doesn't work

Anonymous
Not applicable
Author

What kind of not work ?

What was the input value, what was your expected result and what did you get ?

Anonymous
Not applicable
Author

when I type my input I get the same number without %. So if I enter 3 I get 3.

If I launch the script with Num # (input / 100, '#, ## 0%') as input I get error.


However if I write Num # ('input' / 100 '#, ## 0%') as input I get what I said.

Anonymous
Not applicable
Author

for now I solved it this way: I put in my input table values (eg 4), then in my table where I perform linear calculations I inserted num ([Column Name] / 100, '#, # 0%') and it works, i get 4,00%.

I'm still trying to enter the percentage value in the table, if I can not solve I maintain the solution I found

Colin-Albert

To insert 3%, use 0.03 as the number.

When a  number is formatted as % QlikView automatically multiplies the number by 100

Anonymous
Not applicable
Author

yes, but it's frustrating to enter the number with a comma. I prefer something more immediate and at the moment the second solution is the one that is closest to my goal.