Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
is there a way in Qlik to distribute a value of for instance 100 over a set of lets say Relationship Manager ?
Input: Value x
Output: Random value distribution of x over a dimension y (e.g. Relationship Manager), whereby the sum of distributed values has to be x
Thanks,
Patric
Maybe like this for a integer based distribution:
LOAD * INLINE [
SalesManager
Peter
Paul
Mary
];
Let vValue = 100;
Let vSalesManagerCount = FieldValueCount('SalesManager');
LOAD Sum(Value),
SalesManager
Group by SalesManager;
LOAD 1 as Value,
FieldValue('SalesManager',Ceil(RAND()*$(vSalesManagerCount))) as SalesManager
AutoGenerate $(vValue);
Use this approach: Recipe for a Histogram
@hic
could you please explain your requirement with the sample data ??
if you want to create random data then you could use the random() function
Maybe like this for a integer based distribution:
LOAD * INLINE [
SalesManager
Peter
Paul
Mary
];
Let vValue = 100;
Let vSalesManagerCount = FieldValueCount('SalesManager');
LOAD Sum(Value),
SalesManager
Group by SalesManager;
LOAD 1 as Value,
FieldValue('SalesManager',Ceil(RAND()*$(vSalesManagerCount))) as SalesManager
AutoGenerate $(vValue);