Hi Marc and Henk,
I've been playing a bit with the paramvalue and the prompt macro. We're using them for parameter default values of optional prompts in data elements (before CA 12).
Single select:
In reports I didn't figure out a functional difference as long as I'm using a prompt widget from the toolbox anyway (what makes the parameter exist).
In data modules the prompt macro creates an optional prompt and the paramvalue macro not (like you told). That could be meaningful in dashboards where you have limited options to handle parameters. In reports that could be annoying if not needed.
Multi select:
I didn't figure out how to use the paramvalue macro such that it doesn't turn a multi select parameter into a single select one. The paramvalue and paramdisplayvalue layout calculations in turn can handle multi select parameters. Is it such that the paramvalue macro doesn't support multi select at all? Or if it's possible, how?
------------------------------
Philipp Hornung
Business Intelligence Manager
Techniker Krankenkasse
Hamburg Germany
#IBMChampion
------------------------------
Original Message:
Sent: Fri September 01, 2023 08:31 AM
From: Marc Reed
Subject: Macro ParamValue function always returns a string
@HENK CAZEMIER an update for you. I did a similar thing using STRIP. It made the code a bit easier.
#strip( ParamValue ( 'PString', ' cast ( null as varchar(20)) ' , 'token' ), "'") #
------------------------------
Marc Reed
------------------------------
Original Message:
Sent: Thu August 31, 2023 03:24 PM
From: HENK CAZEMIER
Subject: Macro ParamValue function always returns a string
Hi Marc,
There is a workaround for this issue that may work in your situation. This workaround will continue to work even when the bug-fix has been delivered, as long as the response to the prompt is not a quoted string.
Instead of using:
#ParamValue ( 'PString', ' cast ( null as varchar(20)) ' , 'token' )#
Change it to:
# substitute("'$", "", substitute("^'", "",
ParamValue ( 'PString', ' cast ( null as varchar(20)) ' , 'token' )
))
#
It's a Buckley fix (It tastes awful, and it works).
The substitute operations take out a single quote at the beginning and end of the response of the prompt.
------------------------------
Kind regards,
Henk Cazemier
Original Message:
Sent: Thu August 31, 2023 12:38 PM
From: HENK CAZEMIER
Subject: Macro ParamValue function always returns a string
Hi Marc,
Sorry for the inconvenience, it is a bug.
When 'token' is given as a datatype, it is erroneously interpreted as a 'string'.
Customer support will follow up with you and get it logged.
(It was introduced for handling the global parameter that gives the 'Time perspective' for the Date Relative calculations that are defined in the Gregorian Calendar Data Module. )
------------------------------
Kind regards,
Henk Cazemier