I'm exploring Monte carlo data set to see if we can generate test data as per our needs. We usually use GenRockit to generate such test data. I'm not able implement few requirements via this data set.
1) Area code - It should be randomly selected among 510, 408, 416 .I have tried Options.optionsCSV(Text). But didn't work as these are integers.
2) Mobile number - It should be a random number generated in the format XXX-XXXX (e.g. 257-9011). I couldn't find a way to do that.
3) Conditionally generate Random Integers in Range - I have used this expression, @If(InternationalPlan=="Yes",@random(10,50),@random(0,30)). But the random number generated is a decimal with almost 8-9 digits after the decimal point. Is there a way to generate random integers with in range conditionally? or decimals with limited digits after decimal point.
The outputs you are looking for can be created using a configuration like below. GEOFIELD1/USAGEFIELD1 are numerics, PERSONALFIELD10, 5, 6 and 7 are text fields. Although the MC set generates a text field, the conversion of the area code (GEOFIELD1) to a number is taken care of by the platform. For the phone numbers, there are providers you could use directly (PERSONALFIELD10) but if you really need deeper customization you can combine the two fields yourself in an expression (PERSONALFIELD7). Generating random integers in a range is standard functionality (numberBetween).
If you run/browse/preview this data set, you get output like this
For the third case, random integer generation do exist but I need to be generated conditionally. From the above example I see that we can do it by taking positive integer set and negative integer set in two fields and in the third field we can place the condition. But looks like all these properties should be defined in the application even they used only for computational purpose. Is there a way we can use form temp/virtual fields for such computational purposes?
I agree that it would sometimes be useful if there was support for "local variables". Most often I miss those in strategies and data flows but indeed, sometimes also in the MC dataset. What I usually find myself doing, is re-(or mis-)using (base class) properties that already exist - and there's a lot of them @ baseclass ;).