Over in this thread, racowi kindly helped me out with some code, and the broader SWQL bits I can follow. For example the SELECT, FROM, WHERE
What I'm not understanding is how the rest of the code works logic wise, and wondered if someone here can advise as racowi hasn't been online for a while it appears - and, to be fair, my reply is in the middle of a mess of other posts.
I get the first 3 lines, which is just filtering for specific strings in those records, but the rest is just over my head - so does anyone want to take a punt at typing an explanation for me please?
WHEN EntPhysicalIndex like '1%' AND EntityName = 'Chassis' THEN '1' WHEN EntPhysicalIndex like '2%' AND EntityName = 'Chassis' THEN '2' WHEN EntPhysicalIndex like '3%' AND EntityName = 'Chassis' THEN '3' WHEN EntPhysicalIndex like '4%' AND EntityName = 'Chassis' THEN '4' WHEN EntPhysicalIndex like '5%' AND EntityName = 'Chassis' THEN '5' WHEN EntPhysicalIndex like '6%' AND EntityName = 'Chassis' THEN '6' WHEN EntPhysicalIndex like '7%' AND EntityName = 'Chassis' THEN '7' WHEN EntPhysicalIndex like '8%' AND EntityName = 'Chassis' THEN '8' WHEN ContainedIn like '%1' AND EntityName like 'Port%' THEN '1' WHEN ContainedIn like '%2' AND EntityName like 'Port%' THEN '2' WHEN ContainedIn like '%3' AND EntityName like 'Port%' THEN '3' WHEN ContainedIn like '%4' AND EntityName like 'Port%' THEN '4' WHEN ContainedIn like '%5' AND EntityName like 'Port%' THEN '5' WHEN ContainedIn like '%6' AND EntityName like 'Port%' THEN '6' WHEN ContainedIn like '%7' AND EntityName like 'Port%' THEN '7' WHEN ContainedIn like '%8' AND EntityName like 'Port%' THEN '8' WHEN ContainedIn like '1%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '1' WHEN ContainedIn like '2%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '2' WHEN ContainedIn like '3%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '3' WHEN ContainedIn like '4%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '4' WHEN ContainedIn like '5%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '5' WHEN ContainedIn like '6%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '6' WHEN ContainedIn like '7%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '7' WHEN ContainedIn like '8%' AND EntityName not like 'Port%' AND EntityName <> 'Chassis' THEN '8' ELSE '1' END AS Member