Page 1 of 1

how to put more than one field in a swith condition

Posted: Fri Jan 26, 2024 10:23 am
by flehmann36
Hello, I am despairing...

I hope someone can give me a tip.

I have different fields that I retrieve that produce a number without any blank lines in between. I would like to display this number in a switch selection

The error must be in the syntax somehow, but I can't figure it out

{Objekt.OBJEKT_INTNR}{Format("{0:yy}", Vorgang.VORGANG_VON)}{Month(Vorgang.VORGANG_VON)+80} + Schlüsselsymbol

shows "112392 + Schlüsselsymbol"

if i Copy this into the switch...

{Switch(
Objekt.OBJEKT_INTNR == "11", {Objekt.OBJEKT_INTNR}{Format("{0:yy}", Vorgang.VORGANG_VON)}{Month(Vorgang.VORGANG_VON)+80} + Schlüsselsymbol,
Objekt.OBJEKT_INTNR == "5","xxxxx")}

the is an error "}" expect.

I've tried everything with and without brackets etc

Thanks a lot from Germany

Fabian

Re: how to put more than one field in a swith condition

Posted: Sat Jan 27, 2024 12:28 am
by Lech Kulikowski
Hello Fabian,

Please explain what result do you need?

Full expression should be in one {} brackets, for example:
{"Test1"}+{"Test2"}
result:
"Test1"+"Test2"

{"Test1" + "Test2"}
result:
"Test1Test2"

Thank you.

Re: how to put more than one field in a swith condition

Posted: Sat Jan 27, 2024 2:56 pm
by flehmann36
thank you for the answer Lech.

the problem is, i need the expression in a switch.

this one: {Objekt.OBJEKT_INTNR} {Format("{0:yy}", Vorgang.VORGANG_VON)} {Month(Vorgang.VORGANG_VON)+80} + Text

I need in Switch
{Switch
(
Objekt.OBJEKT_INTNR == "11", {Objekt.OBJEKT_INTNR} {Format("{0:yy}", Vorgang.VORGANG_VON)} {Month(Vorgang.VORGANG_VON)+80} + Text,
Objekt.OBJEKT_INTNR == "5","xxxxx"
)}

I've tried everything with and without brackets etc there are always mistakes.

Thanks

Fabian

Re: how to put more than one field in a swith condition

Posted: Mon Jan 29, 2024 7:50 am
by Lech Kulikowski
Hello,

Try to check;
{Switch
(
Objekt.OBJEKT_INTNR == "11", Objekt.OBJEKT_INTNR+Format("{0:yy}", Vorgang.VORGANG_VON)+Month(Vorgang.VORGANG_VON)+"80"+"Text",
Objekt.OBJEKT_INTNR == "5","xxxxx"
)}

Thank you.

Re: how to put more than one field in a swith condition

Posted: Fri Feb 09, 2024 4:55 pm
by flehmann36
Sorry for answering late. Unfortunately I was sick.

Thank you so much, that was the right answer. I would never have been able to do that. Thank you thank you thank you!

Re: how to put more than one field in a swith condition

Posted: Fri Feb 09, 2024 11:51 pm
by Lech Kulikowski
Hello,

You are welcome.