Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Bangalore, IN

Welcome to the Bangalore User Group

Click the 'Join Group' button to get updates on group news and events.

SOLVED

SQL/Code Help for Input Data from SAP HANA

RAHULMISHRA
8 - Asteroid

I have interfaced HANA DB of my company to In connect DB.

IN HANA Table, One of the view period is mandatory so I have put Codes in SQL editor of Alteryx as :-

 

FROM "_SYS_BIC"."acs.Inventory.InvSummary/QV_INV_DETAIL"('PLACEHOLDER' = ('$$IP_CC$$', '''ALL'''),
'PLACEHOLDER' = ('$$IP_PRCTR_SBU$$', 'PLACEHOLDER' = ('$$IP_SOURCE_SYSTEM$$',
'''ALL'''), 'PLACEHOLDER' = ('$$IP_PLANT$$', '''ALL'''),
'PLACEHOLDER' = ('$$IP_PRCTR_SBG$$', '''SPS'''),
'PLACEHOLDER' = ('$$IP_FISC_PER$$', '2019012'))

 

Instead of above value of '2019012', i want to put a formula which will convert current system date to 'YYYY0MM' format. In HANA table, '2019012' is in NVARCHAR format. 

2 REPLIES 2
Manjunath
8 - Asteroid

Hi @RAHULMISHRA ,

 

Try replacing '2019012' with 'CONCAT(CONCAT(YEAR(CURRENT_TIMESTAMP),"0"),MONTH(CURRENT_TIMESTAMP))'

 

Also Add the below just in case your table contains data from future years compared to 2019:

 

WHERE "TableName"."ColumnName"<=CONCAT(CONCAT(YEAR(CURRENT_TIMESTAMP),'0'),MONTH(CURRENT_TIMESTAMP))

 

I'm sure people will come up with easier Solutions. Do Let me know if it worked!

RAHULMISHRA
8 - Asteroid

Hi Manjunath, This solution worked. thanks for help. Can you please also tell me if i need to filter current period -1  month in the same format what should be the syntax? Thanks In Advance