# Using a "switch" cell to enable easy analysis on different scenarios

5.52K views
0

Recently I was asked if there is a method in Quantrix to save the configuration of a set of variables, then select the configuration from a list allowing mutliple scenario analysis. I’m posting the answer here in case anyone else finds it useful.

This kind of scenario analysis can be done by using a “switch” cell in a Matrix to dictate the values passed into a model.

A “switch” can be created in a cell by using the ‘Constrain Input’ list functionality [color=”DimGray”](Right click on cell > Constrain Input > List)[/color]. The value selected from this list can then be used in an [b:ii9ud2tf]IF [/b:ii9ud2tf]statement, to dictate the values passed into the model.

I have attached an example model that shows the use of a Scenario Switch. In the example model, the Scenario Switch controls the Rate Value that is passed into the Income Growth Results table.

### Attachments

Scenario Analysis EXAMPLE.model

0

[quote="lyledp":2gs27nat]When I first read the subject line of this post I was expecting to see an example of using the switch function. I’ve been wondering how to use this function so it caught my eye.

After looking at the example model I realized that wasn’t the purpose.

BUT, the complex if statement gave me insight on how to use the switch function. I’ve updated the model and included it.

I think using the switch function in this situation clarifies the formula a great deal.
-lyle[/quote:2gs27nat]

Thank you, very useful suggestion.
Christian.

0

Lyle

That’s a good example of the [b:1qgqm6qk]SWITCH[/b:1qgqm6qk] function.

That particular function hadn’t occurred to me at the time I created the example, so thanks for sharing your model!

0

When I first read the subject line of this post I was expecting to see an example of using the switch function. I’ve been wondering how to use this function so it caught my eye.

After looking at the example model I realized that wasn’t the purpose.

BUT, the complex if statement gave me insight on how to use the switch function. I’ve updated the model and included it.

I think using the switch function in this situation clarifies the formula a great deal.
-lyle

### Attachments

ScenarioAnalysisWithSwitchFN.model
0

TX Ranger,

When you use the scenarios in the dimension then you can either show them all in a matrix or move the Scenario Type up to the filter pane to select just one scenario.

You can check this in the attached model (Model Browser -> Folder “Version 2”).

Dominik

0

Great example.

What are the practical differences using a switch vs using a dimension for a different scenario?

Can you put multiple scenarios on the canvas when you use switch?