Hi Milind,
That's likely to be a combination of your data, and the way that CASE statements work. When a case statement gets to a branch that evaluates to true, it executes that branch then exits the statement. I don't know what your data is like, or how you want to evalute it, but you might need to play around with the sequence of the branches. for example:
case
when [FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter]=0 then 'On-premises'
when [FNMP-DW-DS].[Computer-General].[Computer Type] in ('computer', 'VM host') then 'On-premises'
when [FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter] <>0 then 'Cloud'
else ' '
end
------------------------------
Chris Turner
------------------------------
Original Message:
Sent: Fri October 20, 2023 01:42 AM
From: Milind Teli
Subject: XQE-V5-0017 V5 syntax error
Hi Chris,
I tried as above but it is not giving the expected output for 3rd statement. could you please help?
Thanks,
Milind
------------------------------
Milind Teli
Original Message:
Sent: Mon October 16, 2023 06:28 AM
From: Chris Turner
Subject: XQE-V5-0017 V5 syntax error
I think your CASE statement should be something like this:
case
when [FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter]=0 then 'On-premises'
when [FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter] <>0 then 'Cloud'
when [FNMP-DW-DS].[Computer-General].[Computer Type] in ('computer', 'VM host') then 'On-premises'
else ' '
end
------------------------------
Chris Turner
Original Message:
Sent: Fri October 13, 2023 12:53 PM
From: Milind Teli
Subject: XQE-V5-0017 V5 syntax error
Dear all,
I am getting the below error while adding expressions in the report could you please help me to fix this?
Error- XQE-V5-0017 V5 syntax error found for data item 'Hostedin' of query 'Query2', invalid token "else" found after "case when ([FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter]=0) then ('On-premises' ".
CAF-WRN-2082 An error has occurred. Please contact your administrator. The complete error has been logged by CAF with SecureErrorID:2023-10-13-18:47:57.561-#12322
Expression defination:
case when ([FNMP-DW-DS].[Virtual Machine].[Located in Service Provider Datacenter]=0) then ('On-premises' else 'Cloud')
when ([FNMP-DW-DS].[Computer-General].[Computer Type] in ('computer', 'VM host')) then ('On-premises' else ' ') end
Thanks,
Milind
------------------------------
Milind Teli
------------------------------