I could run a query in Microsoft management studio but when I put it into Alteryx and put placeholder it is not working. The output is empty because of the Right('111', 5) = 'Local' . If I replace '111' by the real string it works. However the '111' work as a field name on the top of the query. So I assume I could use the placeholder in the RIGHT(). Is there a way to solve this?
Select vapMB.calendarDate, vapC.companyId, vapMB.indexName, '111'
From TargetDB.vapMultiple.vapCompany As vapC
Join TargetDB.xpressfeed.ciqTradingItem As ciqTI On ciqTI.tickerSymbol = vapC.tickerSymbol
Join TargetDB.vapCoC.vapWeeklyBeta As vapMB On vapMB.tradingItemId = ciqTI.tradingItemId
And vapMB.indexTradingItemId =
Case When Right('111', 5) = 'Local'
Then vapC.tradingItemIdLocalIndex End
Where vapMB.calendarDate >= '333' And vapMB.calendarDate < '444'
And vapC.companyId In ('222') And '111' Is Not Null
Order By vapMB.calendarDate, vapC.companyId
Hi @delalma ,
if I got you right, you want to use '111' as an alias for a field name? Within the SQL statement as it is, '111' is interpreted as a string, an additional field always containing '111' will be created (and RIGHT('111', 5) will never return 'Local'). If vapMB.indexName is the field you want to check and you want to use '111' as a short name, use vapMB.indexName AS '111' in your SQL.
Hopefully this is helpful. If I have completely misunderstood you, please let me know.
Best,
Roland