Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i want to combine two select statement in my report
following are the two nested statements
please help me in writting the corresponding code in script
These are two select statement
SQL SELECT WH.GoodsSender as NCode, SD.InvoiceNumber, SD.SalesDate,SD.ItemNumber,
SD.SaleQuantity, SD.NetValue,SD.MRPValue,SD.TaxAmount
FROM SAP_Link.dbo.Sales_DataNonETP_BIReports SD
INNER JOIN ETPEASV55.dbo.warehouse_sap_bireport WH
ON SD.CustomerId = WH.Warehouse
where SD.Doc_Type = 'ZIKE' and SD.SalesDate >= 20130101 and SD.SalesDate <= '$(currentdate)'
select warehouse,warehousedescription,goodssender from warehouse Where GoodsSender<>'NA' and GoodsSender like 'N%'
union all
select warehouse,warehousedescription,goodssender from ETPPOS.ETPEAS.dbo.Warehouse_SAP Where ISnonETP='Y' and GoodsSender<>'NA' and GoodsSender like 'N%'
Are you trying to this in SQL or in Qlikview ??
if you want to this in Qlikveiw try to take data into qvd format then do the calculation.
Could you please explain what is the relation between to tables? which are the common column between two tables
SQL SELECT WH.GoodsSender as NCode, SD.InvoiceNumber, SD.SalesDate,SD.ItemNumber,
SD.SaleQuantity, SD.NetValue,SD.MRPValue,SD.TaxAmount
FROM SAP_Link.dbo.Sales_DataNonETP_BIReports SD
INNER JOIN ETPEASV55.dbo.warehouse_sap_bireport WH
ON SD.CustomerId = WH.Warehouse
where SD.Doc_Type = 'ZIKE' and SD.SalesDate >= 20130101 and SD.SalesDate <= '$(currentdate)'
i Want this condition with the above one
where warehouse in(select distinct warehouse from warehouse_sap where goadssender like '%N'
warehouse and goads sender are the common columns between two feilds
I want to actually insert the second condition with the first one
how to do that ?
now i want to add this condition also where warehouse in (select distinct warehouse from warehouse_sap where goadssender like '%n'
If ETPEASV55.dbo.werehouse _sap_bireport same like warehouse_sap this table then you can try like below
where wildmatch(goadssender,'n*' )
or goads sender are the common columns between two table then
from ETPEASV55.dbo.werehouse _sap_bireport WH
left join
warehouse_sap WS
on WH.goadssender = WS.goadssender
where WS.goadssender like '%n';
please refer the following image
these are two tables
SAP_Link.dbo.Sales_DataNonETP_BIReports SD and
ETPEASV55.dbo.warehouse_sap_bireport WH
goodssender is the common feild in both