SOLVED

Multiple Data Models in Excel / Power Pivot

Copper Contributor

It is possible to have two data models in Excel? 

 

I need to limit the data in a file that is mass customized for 32 sales people. The file needs two queries in order to be able to calculate their commissions correctly. One query looks for sales the sales person is classified as the outside rep. The other looks for them as the inside rep. 

 

Another way is to write a SQL that pulls in data where they are either the outside or inside rep. I can't figure that out. 

 

Thank you. 

7 Replies
There should be a table containing a field which states whether a sale is out- or in-side. You can use that field to filter the report

@Jan Karel Pieterse 

 

Thank you but that brings in all sales reps into the data model and we need to limit the data to the specific rep: too many rows and we don't want them seeing other reps data.

I don't see why that would be a problem with the solution I propose. Either way you would need to filter the data for the rep opening the file, wouldn't you?

@Jan Karel Pieterse 

 

Hi,

 

There are tow fields: Inside Rep, Outside rep. I need all data where the report rep is either of those.

So the query would need a filter similar to:
WHERE [Inside Rep]="Name of rep" Or [Outside rep]="Name of rep"
And then you could just filter your pivottable for blanks on either the Inside rep or the outside rep field.
best response confirmed by Moscuba (Copper Contributor)
Solution

I figured out the SQL. Interesting thing is that you can't place in the Where clause items that are in the Select clause. That was the issue. 

If I'm not sure about the syntax of a query I tend to use MSAccess' querydesigner to build the query.
1 best response

Accepted Solutions
best response confirmed by Moscuba (Copper Contributor)
Solution

I figured out the SQL. Interesting thing is that you can't place in the Where clause items that are in the Select clause. That was the issue. 

View solution in original post