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