Date from multiple date columns
I am using Tableau and I would like to combine two different date columns
1. purchase_date
2. revenue_date
My case is that there is a delay between purchase creation date and revenue creation date. We sell products and we take the revenue a few days later.
We would like to have a field that the amount dimension to be calculated using revenue date and the number of purchases dimension to be calculation using purchase date. So the desired result is the one displayed below (Expected Tableau result).
Exptected tableau example
tableau
add a comment |
I am using Tableau and I would like to combine two different date columns
1. purchase_date
2. revenue_date
My case is that there is a delay between purchase creation date and revenue creation date. We sell products and we take the revenue a few days later.
We would like to have a field that the amount dimension to be calculated using revenue date and the number of purchases dimension to be calculation using purchase date. So the desired result is the one displayed below (Expected Tableau result).
Exptected tableau example
tableau
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29
add a comment |
I am using Tableau and I would like to combine two different date columns
1. purchase_date
2. revenue_date
My case is that there is a delay between purchase creation date and revenue creation date. We sell products and we take the revenue a few days later.
We would like to have a field that the amount dimension to be calculated using revenue date and the number of purchases dimension to be calculation using purchase date. So the desired result is the one displayed below (Expected Tableau result).
Exptected tableau example
tableau
I am using Tableau and I would like to combine two different date columns
1. purchase_date
2. revenue_date
My case is that there is a delay between purchase creation date and revenue creation date. We sell products and we take the revenue a few days later.
We would like to have a field that the amount dimension to be calculated using revenue date and the number of purchases dimension to be calculation using purchase date. So the desired result is the one displayed below (Expected Tableau result).
Exptected tableau example
tableau
tableau
asked Nov 14 '18 at 17:18
George KaloskopisGeorge Kaloskopis
61
61
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29
add a comment |
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29
add a comment |
1 Answer
1
active
oldest
votes
This task would be easier if you reshape your data (or revise your query) to have two tables. The first describing Orders_Placed with a Purchase Id and Date and Amount Columns
The second table describing Received_Payments with Payment_Id, Order_Id, Date and Amount columns.
If you model your data separately in this case, you can represent situations like - orders that have no payments yet, orders that have a series of partial payments, even overpayments. So there are benefits to not mixing two different types of objects in your data representation. And payments are still tied to orders by the shared Order_Id
Finally, to get the chart you want, you can make two separate connections in Tableau and then use data blending to build your chart. Linking on the date field. Use the Order data source as the primary data source.
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%2f53305583%2fdate-from-multiple-date-columns%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
This task would be easier if you reshape your data (or revise your query) to have two tables. The first describing Orders_Placed with a Purchase Id and Date and Amount Columns
The second table describing Received_Payments with Payment_Id, Order_Id, Date and Amount columns.
If you model your data separately in this case, you can represent situations like - orders that have no payments yet, orders that have a series of partial payments, even overpayments. So there are benefits to not mixing two different types of objects in your data representation. And payments are still tied to orders by the shared Order_Id
Finally, to get the chart you want, you can make two separate connections in Tableau and then use data blending to build your chart. Linking on the date field. Use the Order data source as the primary data source.
add a comment |
This task would be easier if you reshape your data (or revise your query) to have two tables. The first describing Orders_Placed with a Purchase Id and Date and Amount Columns
The second table describing Received_Payments with Payment_Id, Order_Id, Date and Amount columns.
If you model your data separately in this case, you can represent situations like - orders that have no payments yet, orders that have a series of partial payments, even overpayments. So there are benefits to not mixing two different types of objects in your data representation. And payments are still tied to orders by the shared Order_Id
Finally, to get the chart you want, you can make two separate connections in Tableau and then use data blending to build your chart. Linking on the date field. Use the Order data source as the primary data source.
add a comment |
This task would be easier if you reshape your data (or revise your query) to have two tables. The first describing Orders_Placed with a Purchase Id and Date and Amount Columns
The second table describing Received_Payments with Payment_Id, Order_Id, Date and Amount columns.
If you model your data separately in this case, you can represent situations like - orders that have no payments yet, orders that have a series of partial payments, even overpayments. So there are benefits to not mixing two different types of objects in your data representation. And payments are still tied to orders by the shared Order_Id
Finally, to get the chart you want, you can make two separate connections in Tableau and then use data blending to build your chart. Linking on the date field. Use the Order data source as the primary data source.
This task would be easier if you reshape your data (or revise your query) to have two tables. The first describing Orders_Placed with a Purchase Id and Date and Amount Columns
The second table describing Received_Payments with Payment_Id, Order_Id, Date and Amount columns.
If you model your data separately in this case, you can represent situations like - orders that have no payments yet, orders that have a series of partial payments, even overpayments. So there are benefits to not mixing two different types of objects in your data representation. And payments are still tied to orders by the shared Order_Id
Finally, to get the chart you want, you can make two separate connections in Tableau and then use data blending to build your chart. Linking on the date field. Use the Order data source as the primary data source.
edited Nov 14 '18 at 18:03
answered Nov 14 '18 at 17:33
Alex BlakemoreAlex Blakemore
8,30421840
8,30421840
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%2f53305583%2fdate-from-multiple-date-columns%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
Are you using the Tableau API to write code to do this? If so, show your Minimal, Complete, and Verifiable example. Otherwise, it is likely off-topic for SO.
– jdv
Nov 14 '18 at 17:27
Sounds like you a mixing cash basis and accrual basis views of the data
– Alex Blakemore
Nov 14 '18 at 17:29