Forum Discussion
Greeting User Login Message
- 3 years ago
Hi NickzNickz ,
What a great idea to greet your users!How about this:
Measure = VAR _User = USERNAME() VAR _Hour = HOUR(NOW()) VAR _Prefix = SWITCH( TRUE(), _Hour < 12, "Good Morning ", _Hour >= 12 && _Hour < 17, "Good Afternoon ", "Good Evening " ) RETURN CONCATENATE(_Prefix, SUBSTITUTE(_User, "DOMAIN\", "") )Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Hi NickzNickz
please try
Greeting User =
VAR _User =
PATHITEM ( SUBSTITUTE ( USERNAME (), "/", "|" ), 2 )
VAR _Hour =
HOUR ( NOW () )
VAR _Prefix =
SWITCH (
TRUE (),
_Hour < 12, "Good Morning ",
_Hour >= 12
&& _Hour < 17, "Good Afternoon ",
"Good Evening "
)
RETURN
CONCATENATE ( _Prefix, _User )
- tamerj13 years agoCommunity Champion
Of it it is afternoon in your local time then it should.
- tamerj13 years agoCommunity Champion
Just noticed the mistake. I used "/" instead of "\" 😅
Greeting User =
VAR _User =
PATHITEM ( SUBSTITUTE ( USERNAME (), "\", "|" ), 2 )
VAR _Hour =
HOUR ( NOW () )
VAR _Prefix =
SWITCH (
TRUE (),
_Hour < 12, "Good Morning ",
_Hour >= 12
&& _Hour < 17, "Good Afternoon ",
"Good Evening "
)
RETURN
CONCATENATE ( _Prefix, _User )