Replacing Foreign Key with Reference Name from other table in SSRS report
I am creating an SSRS matrix report in which Loans are mapped with primary keys of Employees originated the loan, so the tables looks like:
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
When I create the matrix using first table I get:
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
But I wanted result like:
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
How can I relate the name of values in rows groups to take out the names of Employees?
reporting-services
add a comment |
I am creating an SSRS matrix report in which Loans are mapped with primary keys of Employees originated the loan, so the tables looks like:
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
When I create the matrix using first table I get:
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
But I wanted result like:
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
How can I relate the name of values in rows groups to take out the names of Employees?
reporting-services
add a comment |
I am creating an SSRS matrix report in which Loans are mapped with primary keys of Employees originated the loan, so the tables looks like:
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
When I create the matrix using first table I get:
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
But I wanted result like:
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
How can I relate the name of values in rows groups to take out the names of Employees?
reporting-services
I am creating an SSRS matrix report in which Loans are mapped with primary keys of Employees originated the loan, so the tables looks like:
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
When I create the matrix using first table I get:
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
But I wanted result like:
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
How can I relate the name of values in rows groups to take out the names of Employees?
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>LoanID</td><td>Employee</td></tr><tr><td>101</td><td>1</td></tr><tr><td>102</td><td>2</td></tr><tr><td>103</td><td>3</td></tr><tr><td>104</td><td>2</td></tr><tr><td>105</td><td>1</td></tr><tr><td>106</td><td>2</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
<table><tbody><tr><td>Employeeid</td><td>Employee Name</td></tr><tr><td>1</td><td>A</td></tr><tr><td>2</td><td>B</td></tr><tr><td>3</td><td>C</td></tr></tbody></table>
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
<table><tbody><tr><td>Employee</td><td>Count Of Loans</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>3</td></tr><tr><td>3</td><td>1</td></tr></tbody></table>
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
<table><tbody><tr><td>Employee</td><td>Count of Loans</td></tr><tr><td>A</td><td>2</td></tr><tr><td>B</td><td>3</td></tr><tr><td>C</td><td>1</td></tr></tbody></table>
reporting-services
reporting-services
edited Nov 25 '18 at 10:23
Mayank Chhibber
asked Nov 25 '18 at 9:59
Mayank ChhibberMayank Chhibber
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It is generally better to join tables in the source system when you can. To answer your question, you can use the Lookup
function to get the Employee Name from the second dataset. In this case it would look something like this:
=Lookup(Fields!Employee.Value, Fields!EmployeeID.Value, Fields!EmployeeName.Value, "DataSet2")
In other words, for each row, it is looking up the employee ID in the second dataset and returning the name.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53466411%2freplacing-foreign-key-with-reference-name-from-other-table-in-ssrs-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It is generally better to join tables in the source system when you can. To answer your question, you can use the Lookup
function to get the Employee Name from the second dataset. In this case it would look something like this:
=Lookup(Fields!Employee.Value, Fields!EmployeeID.Value, Fields!EmployeeName.Value, "DataSet2")
In other words, for each row, it is looking up the employee ID in the second dataset and returning the name.
add a comment |
It is generally better to join tables in the source system when you can. To answer your question, you can use the Lookup
function to get the Employee Name from the second dataset. In this case it would look something like this:
=Lookup(Fields!Employee.Value, Fields!EmployeeID.Value, Fields!EmployeeName.Value, "DataSet2")
In other words, for each row, it is looking up the employee ID in the second dataset and returning the name.
add a comment |
It is generally better to join tables in the source system when you can. To answer your question, you can use the Lookup
function to get the Employee Name from the second dataset. In this case it would look something like this:
=Lookup(Fields!Employee.Value, Fields!EmployeeID.Value, Fields!EmployeeName.Value, "DataSet2")
In other words, for each row, it is looking up the employee ID in the second dataset and returning the name.
It is generally better to join tables in the source system when you can. To answer your question, you can use the Lookup
function to get the Employee Name from the second dataset. In this case it would look something like this:
=Lookup(Fields!Employee.Value, Fields!EmployeeID.Value, Fields!EmployeeName.Value, "DataSet2")
In other words, for each row, it is looking up the employee ID in the second dataset and returning the name.
answered Nov 26 '18 at 21:46
StevenWhiteStevenWhite
4,51921136
4,51921136
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53466411%2freplacing-foreign-key-with-reference-name-from-other-table-in-ssrs-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown