,(case when(SoftwareCompliance=1 and is_softwareChecked=1) then 'Compliance'
when (SoftwareCompliance=2 and is_softwareChecked=1) then 'Non-Compliance'
end) as reconcilestatus

,(case when (invtbl.Is_Inventory=1 and invtbl.is_softwareChecked=1) then 'Inventory'
when (invtbl.Is_Inventory=2 and invtbl.is_softwareChecked=1) then 'Non-Inventory'
end) as Softwaretypechart

,(case when (invtbl.licsensetype_id = 1 and invtbl.is_inventory=1) then 'MPN'
when (invtbl.licsensetype_id = 2 and invtbl.is_inventory=1) then 'Volume'
when (invtbl.licsensetype_id = 6 and invtbl.is_inventory=1) then 'OEM'
end) as lictype
,a.totalcost

from sam_sit2.tbl_softwarelicenseinventory invtbl

left join tbl_softwareinvstatus sistbl on invtbl.SoftwareLincenseInvetory_Id=sistbl.softwareinv_id