[Feature] Pattern based select function

You are missing a feature? Start a request here.
Antworten
Benutzeravatar
gawalione
Administrator
Beiträge: 121
Registriert: 7. Oktober 2017, 00:28

Pattern based select function

28. Juni 2019, 18:24

In some caches you get a value like an year number and use it for several variables like "xAxB".
The second number should be A, the last one B. Or "xAAx" where A should be composed from second and third letter.
Currently you can not prepare this because you have to enter the year value into the solver to be able to select the desired numbers/letters.
It would be nice to have a field to specify a pattern for selecting the parts of value.
Something like A = x$xx, B = xxx$, or A = x$$x

no avatar
hampf
Beiträge: 12
Registriert: 20. April 2018, 14:47

Re: Pattern based select function

19. Januar 2020, 13:06

to push this topic a little bit:

Hi gawalione,
you could intrdoce a new function "pattern()":

Variable YEAR (yes: four letters to distinguish it from the "normal" variables)
Wert:
Notiz:
angewendete Funktionen:
pattern(ABCD)

to automatically parse the value into variables. At the moment I manually create a variable YEAR and use formulas for A, B, C and D with wahl(import(YEAR)) and select the corresponding digit as a workaround for this missing - and often used - feature.

new feature pattern("ABBC") would result in

YEAR
Wert: 1986
Funktionen:
pattern(ABCD)
"gefundene Variablen":
A=1
B=98
C=6


"Analyse" pattern and create corresponding variables just like analyzing formulas as usual!
"Parse" digits like in wahl()
use $ or - as a "not used" option, so that

YEAR
1987
pattern(AB-C)

would create A=1, B=9 and C=7

This could manually be done just like described above, so I think this would not be a big problem to implement, because Solver can do that already - a bit more complicated and manually, but even with two digits selection for a single variable. Downside of the manual method: I have to input a "dummy" year before I can select them in "wahl()" after importing them in A, B, C, and D. If no dummy is present I cannot check the boxes. With "pattern()" this would save a LOT of time.

Woraround at the moment:

YEAR
1986

A
wahl(import(YEAR))
[x]
[ ]
[ ]
[ ]

B
wahl(import(YEAR))
[ ]
[x]
[x]
[ ]

C
wahl(import(YEAR))
[ ]
[ ]
[ ]
[x]

After that I delete the value 1986 from YEAR to "reset" A, B and C to "nothing". The formulas then work as well when I enter the real year in the field.

Cheers,
Hampf

Antworten