A new option: Generate Data: Map Values (key, value)
Please, consider adding a new option: Generate Data - Map values: (key, value).
A very simple use-case - assume there are 3 scenarios:
Scenario | State of nature |
---|---|
1 | bad weather |
2 | average weather |
3 | good weather |
You create Spreadsheet1 (a lookup table):
Scenario | Sales | Fixed Cost |
---|---|---|
1 | 10 | 30 |
2 | 100 | 30 |
3 | 100 | 30 |
In another spreadsheet ("Spreadsheet2") you create the column "Scenario" and generate 3 random numbers from a uniform distribution to create 3 random scenarios (i.e. either the 1, 2 or 3). Now you want to map those Scenarios into Sales, so you right-click on the "Scenario" column in Spreadsheet2 > Generate Data > Map Values and LabPlot should automatically suggest "All, "Sales" and "Fixed Cost". If you select "Sales", LabPlot creates a new column called "Sales" in Spreadsheet2 and picks up the values for this column from the lookup table (Spreadsheet1). If you select "All", both "Sales" and "Fixed Cost" columns will be added with proper values.
Spreadsheet2:
Scenario | **Sales (mapped values) |
---|---|
1 | 10 |
2 | 100 |
2 | 100 |
Arguments:
- Source: Spreadsheet1
- Key: Scenario
- Value: Sales
- Missing: -
See how it works in DataGraph: