June 17, 2014 at 1:32 pm
Can anyone out there advise me on how to generate a random number within in SSRS by means of a function and/or expression? I understand this can be done using TSQL, I would like to know how to accomplish this within SSRS.
My attempt so far is: =RunningValue(Fields!qty.Value, COUNT, Nothing)
Which is not random enough...
Thanks in Advance for any help!!
June 18, 2014 at 4:04 am
June 18, 2014 at 7:53 am
Thanks Jo for the reply. The rnd function certainly does what I need. My only problem now is that I want to only display the numbers after the decimal.
June 19, 2014 at 4:42 am
Can you give an example of "only display the numbers after the decimal related to random"?
June 19, 2014 at 4:51 am
GBeezy (6/18/2014)
Thanks Jo for the reply. The rnd function certainly does what I need. My only problem now is that I want to only display the numbers after the decimal.
You could treat it as a string, search for the decimal seperator and take everything that comes after it.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 19, 2014 at 4:52 am
Koen Verbeeck (6/19/2014)
GBeezy (6/18/2014)
Thanks Jo for the reply. The rnd function certainly does what I need. My only problem now is that I want to only display the numbers after the decimal.You could treat it as a string, search for the decimal seperator and take everything that comes after it.
Or if you want a fixed number of decimals, let's say 3, you can for example multiply by 1000 and then take the modulo of 1000.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 20, 2015 at 12:29 am
CEILING(RND()*1000)
Might help someone.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply