Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multidimensional LOOKUP variables not supported #406

Open
rogersamso opened this issue Apr 6, 2023 · 0 comments
Open

Multidimensional LOOKUP variables not supported #406

rogersamso opened this issue Apr 6, 2023 · 0 comments

Comments

@rogersamso
Copy link
Contributor

Vensim allows the definition of multidimensional lookups of the form:

{UTF-8}
dim1:
	a, b, c
	~	
	~		|

dim2:
	g1, g2
	~	
	~		|

L_1[g1, dim1](
	GET_DIRECT_LOOKUPS( 'test_lookups.xlsx' , 'Sheet1' , 'x_1' , 'vals_1' )) ~~|
L_1[g2, dim1](
	GET_DIRECT_LOOKUPS( 'test_lookups.xlsx' , 'Sheet1' , 'x_2' , 'vals_2' ))
	~	
	~		|

var2[dim2, dim1]=
	L_1[dim2,dim1](Time)
	~	
	~		|

This does not work in PySD, but the following workaround may be used:

{UTF-8}

dim1:
	a, b, c
	~	
	~		|

dim2:
	g1, g2
	~	
	~		|

L_2[g2,dim1](
	GET_DIRECT_LOOKUPS( 'test_lookups.xlsx' , 'Sheet1' , 'x_2' , 'vals_2' ))
	~	
	~		|

L_1[g1, dim1](
	GET_DIRECT_LOOKUPS( 'test_lookups.xlsx' , 'Sheet1' , 'x_1' , 'vals_1' ))
	~	
	~		|

var2[g1, dim1]=
	L_1[g1,dim1](Time) ~~|
var2[g2,dim1]=
	L_2[g2,dim1](Time)
	~	
	~		|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants