Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Harm1
Contributor
Contributor

Add calculated field

Hello everybody,

I want to make a calculated field in my data manager. 
Over there i put in the 'expression box' the next formula: 
if(rand( )<0,115 , 'NO' [rand( )*1070000)+70000)]) 
I want a chance of 11,5% that it is a No and everything else has to be a random nummer between 1070000 and 1140000. 
But this doesn't work, hopefully somebody can help me out! 


Labels (5)
4 Replies
Clement15
Creator III
Creator III

Hello, could this work?
if(rand() < 0.115, 'NO', round(rand()*70000+1070000))

Harm1
Contributor
Contributor
Author

It's working a little bit. But now i have in each field the same number. And i want in each cell a different number/NO. 

Clement15
Creator III
Creator III

When operating randomly, it is not possible to obtain distinct results with rand()

Nicolae_Alecu
Creator
Creator

Hello, 

You could try this: 

IF(RAND()<0.115, 'NO', RAND()*107000+70000) 

But RAND() it's not random, it's a normal distribution.