Forum Discussion

keshavmurthyn's avatar
keshavmurthyn
New Member
5 years ago
Solved

I want to connect IBM DB2 through Direct query with the SQL statement option

Hai Team,

Im trying to connect to IBM DB2 through direct query mode but Its not allowing me to write a SQL statement. I want to create some calculated column like , 

 

DateMonth      year

522                   21

523                    21

524                    21

.

.

.  

 

I have a column like this 5th month and 22nd day I want to use these columns and calculate date column like 05/22/21. Conditions are I have to use Direct Query. It would be really appreciatable if anybody can solve my problem.

 

Thanks in Advance!

  • Hi keshavmurthyn ,

     

    Create a column as below:

    Date = 
    var _month=LEFT('Table'[DateMonth ],1)
    var _day=RIGHT('Table'[DateMonth ],LEN('Table'[DateMonth ])-1)
    Return
    DATE(20&'Table'[year],_month,_day)

    And you will see:

    Calculated column is supported in direct query mode.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

1 Reply

  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi keshavmurthyn ,

     

    Create a column as below:

    Date = 
    var _month=LEFT('Table'[DateMonth ],1)
    var _day=RIGHT('Table'[DateMonth ],LEN('Table'[DateMonth ])-1)
    Return
    DATE(20&'Table'[year],_month,_day)

    And you will see:

    Calculated column is supported in direct query mode.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!