Hi all,
I need help in replicating the below SQL Server AdventureWorks2012 database code into a Alteryx workflow. Here, I'm getting stuck at implementing 'NOT IN' functionality in Filter tool. I shouldn't input the SQL code into the Alteryx tool. I should completely make use of Alteryx tools which gives the similar SQL functionality. No Pre SQL or Post SQL statements should be used.
Kindly help me out with the workflow for the SQL query.
Select [ProductCategoryID] AS ProductID, [StandardCost], [Weight], [ListPrice],[StartDate],[UnitMeasureCode], [TransactionDate],
CASE WHEN DAY(PC.[ModifiedDate]) > 1 THEN CAST(CAST(YEAR(DATEADD(MONTH,4,PC.[ModifiedDate])) AS NVARCHAR) + '-' + CAST(MONTH(DATEADD(MONTH,4,PC.[ModifiedDate])) AS NVARCHAR) + '-01' AS DATE) ELSE DATEADD(MONTH,3,PC.[ModifiedDate]) END AS [DateStartedIncentive]
From [AdventureWorks2012].[Production].[Product] P
INNER JOIN [AdventureWorks2012].[Production].[ProductCategory] PC ON P.[ProductID] = PC.[ProductCategoryID]
LEFT JOIN [AdventureWorks2012].[Purchasing].[ProductVendor] PV ON PC.[ProductCategoryID] = PV.[ProductID]
LEFT JOIN [AdventureWorks2012].[Sales].[SalesOrderDetail] SOD ON PV.[ProductID] = SOD.[ProductID] LEFT JOIN [AdventureWorks2012].[Production].[TransactionHistory] TH ON SOD.[ProductID] = TH.[ProductID]
WHERE [Productid] + [SalesOrderID] + [ProductCategoryID] NOT IN
(Select [CustomerID] + [TerritoryID] + [CustomerType]
FROM [AdventureWorks2012].[Sales].[Customer] WHERE DateADD(Month, -2, GETDATE()) AS ModifiedDate)
GROUP BY rowguid
Thanks in advance,
Best Regards,
Sreenivasa Teja.