All,
I am writing a report based in eCW's eBO. I have a radio button that allows the user to toggle between two types of providers: the appointment provider and the resource providers. I also have a radio button that allows the user to toggle between two types of reports: a summary report, and a detail report. The reports won't work because I can't seem to get the expressions right. Below is an example of the expression that I originally tried to insert into a data item but I get a 'QE-DEF-0459 CCLException' error that indicates that my parsing is off. Is the methodology or the expression wrong? Or, are they both wrong?
if (?Provider_Toggle? = 'Appointment Provider') then
([EMR Reporting].[Appointment Providers].[Appointment Provider Last Name]) else
if (?Provider_Toggle? = 'Resource Provider') then ([Resource Provider Last Name]) else ('None')
You at least need parenthesis around your first "else" statement.
Something like:
if (?Provider_Toggle? = 'Appointment Provider')
then ([EMR Reporting].[Appointment Providers].[Appointment Provider Last Name])
else (
if (?Provider_Toggle? = 'Resource Provider')
then ([Resource Provider Last Name])
else ('None')
)
Hope this helps.
Adam
Quote from: adam_mc on 22 Jan 2020 01:19:32 PM
You at least need parenthesis around your first "else" statement.
Something like:
if (?Provider_Toggle? = 'Appointment Provider')
then ([EMR Reporting].[Appointment Providers].[Appointment Provider Last Name])
else (
if (?Provider_Toggle? = 'Resource Provider')
then ([Resource Provider Last Name])
else ('None')
)
Hey, thanks for answering! I just tried to do that, but it didn't work. I still got the same error.
What happens if the entry is neither appointment provider or resource provider?
Quotethen ([Resource Provider Last Name])
Are you sure you want a 1 part name here and not a 3 part name?
Have you thought about making the expression a case ?
Create an expression with just the nested bit and see if that works. That would reduce the problem space.
What is the exact wording of the error?
Because I manage to lose track of brackets, I generally prefer case statements if things get elongated:
case
when ?Provider_Toggle? = 'Appointment Provider' then [EMR Reporting].[Appointment Providers].[Appointment Provider Last Name]
when ?Provider_Toggle? = 'Resource Provider' then [Resource Provider Last Name]
else 'None'
end
Also, is this of any use? https://www.cognoise.com/index.php?topic=28925.0
I just tried that and I still get the same error. Is it the methodology? I'm trying to put it into a data item. Should I be writing it as a filter, or expression elsewhere?
Quote from: BigChris on 23 Jan 2020 02:49:07 AM
Also, is this of any use? https://www.cognoise.com/index.php?topic=28925.0
That may be of assistance. I tried to copy the pattern you created. Here is the code I wrote:
IF( (?Provider_Toggle? = 'Appointment Provider')
THEN ([EMR Reporting].[Appointment Providers].[Appointment Provider Last Name])
ELSE ([Resource Provider Last Name])