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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Generate Minus (-) and Positive (+) Numbers


Hi Qlik Community Members,

I have to say, i'm really starting to enjoy myself in this new found world of QlikView Goodness!!

I'm still getting used to a lot of the tools and functions coming from a SAS background there is a lot to learn, especially terminology wise.

my issue:

I need to generate a table from my main table that has a £ value number next to it from as much as -£1200 to £500

is this possible?

I Cant seem to find a RANDBETWEEN function like in excel

thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

RAND() will return a floating point random number between 0 and 1, so just scale the number:

LOAD

     money(round(RAND()*1700,0.01)-1200) AS Amount

Autogenerate 10000;

View solution in original post

7 Replies
MK_QSL
MVP
MVP

You mean to say you want to generate these numbers randomly?

swuehl
MVP
MVP

RAND() will return a floating point random number between 0 and 1, so just scale the number:

LOAD

     money(round(RAND()*1700,0.01)-1200) AS Amount

Autogenerate 10000;

ThornOfCrowns
Specialist II
Specialist II

Try: =-1200+(Rand()*1700)

Not applicable
Author

Brilliant answers thank you all.

so on the back of that, whats the logic behind creating random permutations of a letter, Y or N?

again, thanks

Not applicable
Author

This works just brilliant, thank you so much James

swuehl
MVP
MVP

Maybe

LOAD

     if(RAND() <=0.5,'Y','N') as RandomLetter

autogenerate 10000;

Not applicable
Author

Perfect, thank you again