Python Forum

Full Version: Goal Seek
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello every body , I am trying to replicate the goal seek function in excel . I have 5 formulas that have the same 4 variables that we need to solve for. We have what the formulas should equal . For example purposes we will use 250 . we also have M in the formula that is a known value. All of the A12-A55 values are know values pulled from a matrix table. I need to be able to potentially incorporate this into Tabpy as the values we would have in tableau and then send them forumulas to Tabpy and have it optimize the 4 unknown variables values and send them back .

Lets define the 4 Variables that are unknow that we need to solve for below.
A
B
C
D


250 = [M]+A*[A12]+B*[A13]+C*[A14]+D*[A15]
250 = [M]+A*[A22]+B*[A23]+C*[A24]+D*[A25]
250= [M]+A*[A32]+B*[A33]+C*[A34]+D*[A35]
250= [M]+A*[A42]+B*[A43]+C*[A44]+D*[A45]
250= [M]+A*[A52]+B*[A53]+C*[A54]+D*[A55]

Question 1:how could we write this code in python?
Is Tabpy an option? if so question 2

Question 2: does any body have any idea how we could potentially do something like this utilizing Tableau and Tabpy table extension