Use SV-Name with other SV-Value

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
tlkjb
Posts: 88
Joined: Thu Aug 26, 2021 10:08 am

Hello!

I am trying to find a solution for the following task:

I have a quite long list of stored values that I import from a csv-File. Their names are "0","1","2","3", etc.

Now I have a calculation with the result X. Let's say X = 2. Is there a way to get the value of the Stored Value named "2" (like you would do with an an Array in programming)? I thought of some combination of normal Stored Values and Text Stored Values?

Of course I could have a very long list of Automation Rules with the compare condition for each Stored Value, but I really hope there is a better way to do that.

Thanks
sniffer66
Posts: 1824
Joined: Thu May 02, 2019 8:37 am

I'm a bit confused by the question.

For the sake of clarity lets give the SV's an alpha name. So you have a set of imported SV's with a name and a value

i.e

a=2
b=3
c=4
d=5
etc

You want to know what the value of the SV named "b" is ?
User avatar
tlkjb
Posts: 88
Joined: Thu Aug 26, 2021 10:08 am

Thanks for your reply. Sorry if it's not clear what I mean. 2nd try:

In a normal programming language I would do the following:

Define an Array that is a holding a list of "source"-values:

Array[0] = 0.125
Array[1]= 0.194
Array[2]= 0.234
Array[3]= 0.386
etc

Define X is an Integer to address and get the different values in the Array:

For example
If X = 1 -> Array [x] -> 0.194
or
If X = 3 -> Array [x] -> 0.386
etc

As Betangel doesn't know Arrays I defined a list of Stored Values:

"0" = 0.125
"1" = 0.194
"2" = 0.234
"3" = 0.386
etc

I named these Stored Values with numbers (and not letters) to maybe find a solution of a "workaround Array" by the help of "Text Stored Values". So for example if X = 1, I would like to get the value of the Stored Value with name of "1" (which would be 0.194) to then save it to another Stored Value ("Y") and use it for further calculations.

I do understand that I could use an Automation Rule File with a list of Rules, where each Rule has a Condition to check for a specific value of X (Rule A -> Condition X = 0 -> Stored Value Y = 0.125; Rule B -> Condition X = 1 -> Stored Value Y = 0.194; etc...). As my list of possible iterations of X is over 50 values long, I really would like to avoid having such a massive Rules File.

Thanks
User avatar
decomez6
Posts: 695
Joined: Mon Oct 07, 2019 5:26 pm

tlkjb wrote:
Wed Jan 05, 2022 10:22 am


Array[0] = 0.125
Array[1]= 0.194
Array[2]= 0.234
Array[3]= 0.386
etc
As Betangel doesn't know Arrays I defined a list of Stored Values:

"0" = 0.125
"1" = 0.194
"2" = 0.234
"3" = 0.386
etc
store multiple instances of Z :

-store Z with another stored value "0" = 0.125
-store Z with another stored value "1" = 0.194
-store Z with another stored value "2" = 0.234
etc

Store X with another stored value Z ( with or without condition )
Store Y with another stored value Z ( with or without condition )

I dont have much experience with arrays , so not sure if i am just repeating what you already know .
worth a try though :)
User avatar
tlkjb
Posts: 88
Joined: Thu Aug 26, 2021 10:08 am

decomez6 wrote:
Wed Jan 05, 2022 5:10 pm
store multiple instances of Z :

-store Z with another stored value "0" = 0.125
-store Z with another stored value "1" = 0.194
-store Z with another stored value "2" = 0.234
etc

Store X with another stored value Z ( with or without condition )
Store Y with another stored value Z ( with or without condition )

I dont have much experience with arrays , so not sure if i am just repeating what you already know .
worth a try though :)
Thanks
It's another way to get the job done, I am aware of that. But it's still not the smooth "one-liner solution", I am trying to find.
sniffer66
Posts: 1824
Joined: Thu May 02, 2019 8:37 am

The best way I can think to do it is externally in code

Set up both an import SV values to a csv, and also an import. Get your code\script to read the exported csv when X is set with a value. Query for that value in the external array, write out the value to an importable csv, and return it back to BA via an import rule. I've not done it that way but it should work, and could be pretty fast

I use import CSV's extensively and they work really well getting external data into Guardian, not just as a once off but during in-play, and fast !
User avatar
tlkjb
Posts: 88
Joined: Thu Aug 26, 2021 10:08 am

Thanks. That's probably the best way to go. I always try to do as much as possible within BA-Automation, but for some more complex stuff BA-Automation is just not the right fit.
sniffer66
Posts: 1824
Joined: Thu May 02, 2019 8:37 am

sniffer66 wrote:
Thu Jan 06, 2022 7:33 am
The best way I can think to do it is externally in code

Set up both an import SV values to a csv, and also an import. Get your code\script to read the exported csv when X is set with a value. Query for that value in the external array, write out the value to an importable csv, and return it back to BA via an import rule. I've not done it that way but it should work, and could be pretty fast

I use import CSV's extensively and they work really well getting external data into Guardian, not just as a once off but during in-play, and fast !
Your question, and my answer, actually gave me an idea that I've been able to implement this morning. If you take a look at my previous thread here, and my latest post I've actually been able to get the export/import solution working to solve another problem I'd been having.

if you can follow the code on my latest post in that thread you'll have the solution to your own issue, using a CSV export/import setup in Guardian :)

viewtopic.php?f=50&t=24908&p=288130#p288130
User avatar
tlkjb
Posts: 88
Joined: Thu Aug 26, 2021 10:08 am

sniffer66 wrote:
Thu Jan 06, 2022 1:11 pm
sniffer66 wrote:
Thu Jan 06, 2022 7:33 am
The best way I can think to do it is externally in code

Set up both an import SV values to a csv, and also an import. Get your code\script to read the exported csv when X is set with a value. Query for that value in the external array, write out the value to an importable csv, and return it back to BA via an import rule. I've not done it that way but it should work, and could be pretty fast

I use import CSV's extensively and they work really well getting external data into Guardian, not just as a once off but during in-play, and fast !
Your question, and my answer, actually gave me an idea that I've been able to implement this morning. If you take a look at my previous thread here, and my latest post I've actually been able to get the export/import solution working to solve another problem I'd been having.

if you can follow the code on my latest post in that thread you'll have the solution to your own issue, using a CSV export/import setup in Guardian :)

viewtopic.php?f=50&t=24908&p=288130#p288130
Thanks for sharing
Post Reply

Return to “Bet Angel - Automation”