locked
powerpivot - query to import data RRS feed

  • Question

  • I wrote a query to import data from terdata to power pivot and it works good. But I want to parameterise the query so that I can change it every month. I need to parameterise the 2 fields in the where clause and fscl_yr_nbr=2012
    and fscl_qtr_nbr=2. can you please let me know the best way to do this , I tried native sql way and it does not seem to work that way, by putting the declaration before the  sql.

    select
    enti_nbr,
    enti_nm
    from alignment a
    where sales_div_nbr=1
    and sales_grp_nbr=2
    and sales_org_nbr=7
    and fscl_yr_nbr=2012
    and fscl_qtr_nbr=2
    and align_typ_cd='P'

    Tuesday, March 13, 2012 9:06 PM

Answers

All replies

  • I wrote a query to import data from terdata to power pivot and it works good. But I want to parameterise the query so that I can change it every month. I need to parameterise the 2 fieldsa in the where clause and fscl_yr_nbr=2012
    and fscl_qtr_nbr=2. can you please let me know the best way to do this , I tried native sql way and it does not seem to work that way, by putting the declaration before the  sql.

    select
    enti_nbr,
    enti_nm
    from alignment a
    where sales_div_nbr=1
    and sales_grp_nbr=2
    and sales_org_nbr=7
    and fscl_yr_nbr=2012
    and fscl_qtr_nbr=2
    and align_typ_cd='P'

    • Merged by Challen Fu Thursday, March 15, 2012 7:41 AM duplicated thread
    Tuesday, March 13, 2012 8:50 PM
  • Hi Developerbo1,

    To this requirement, I would recommend you follow this thread http://social.msdn.microsoft.com/Forums/en/sqlkjpowerpivotforexcel/thread/b579e218-e4f0-4153-81d1-eac96692d423 

    Thanks,


    Challen Fu

    TechNet Community Support

    • Marked as answer by Challen Fu Wednesday, March 21, 2012 10:03 AM
    Thursday, March 15, 2012 7:39 AM
  • write a store procedure and use it to import

    -- This posting is provided "AS IS" with no warranties, and confers no rights

    • Marked as answer by Challen Fu Wednesday, March 21, 2012 10:03 AM
    Monday, March 19, 2012 5:35 AM