Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: PQ to Create a Query From Another Query

  1. #1
    Board Regular
    Join Date
    Jun 2014
    Posts
    964
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default PQ to Create a Query From Another Query


    PQ to Create a Query From Another Query
    I have a query that combines two Excel files from a folder. Within the two files there is a Fiscal Year (2016, 2017) column. I would like to know how I can create a second query based on the first query that separate the files by Fiscal Year. If a new Excel file get's added to the folder with a column for Fiscal Year 2018. Then the second query should be able to create another query based on the 2018 Fiscal Year records when I click the refresh button.

    Any advice is appreciated.

    Thanks!
    Last edited by legalhustler; Sep 12th, 2017 at 12:18 PM.

  2. #2
    Board Regular
    Join Date
    Jun 2014
    Posts
    964
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: PQ to Create a Query From Another Query

    Based on some research, I found that you can REFERENCE a query by right clicking it and selecting "Reference"; however, it's not exactly what I want, because from Query1 I would like to create separate queries extracted based on the fiscal year column of Query1. I would like a query for 2016, 2017, 2018 etc and whenever I refresh my workbook it should automatically generate a query for any new fiscal year.
    Last edited by legalhustler; Sep 12th, 2017 at 03:34 PM.

  3. #3
    Board Regular
    Join Date
    Jun 2014
    Posts
    964
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: PQ to Create a Query From Another Query

    Here is a visual way of looking at my issue:

    Query1 has the following columns: | Fiscal Year | B | C | D | E | F | G |

    Under Fiscal Year there are records for 2016 and 2017.

    I would like the Query Editor to automatically generate queries that creates table for all 2016 records and another query for 2017 records whenever I refresh the workbook. Is this possible?

    The end result is having Query1 (as the combined file) and two additional queries like below:

    | 2016 | B | C | D | E | F | G |


    | 2017 | B | C | D | E | F | G |

  4. #4
    Board Regular
    Join Date
    Jun 2014
    Posts
    964
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: PQ to Create a Query From Another Query

    Anyone?

  5. #5
    Board Regular
    Join Date
    Sep 2013
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: PQ to Create a Query From Another Query

    Make duplicate query and change filter for corresponding year

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com