Time is a valuable measure to obtain in an online transaction. With time we can see a trend in each of the available deals. However, it is undeniable that when a database stores the time of a successful transaction, there is segmentation between each time unit.
For example, in the image above, several units of time and date are separate and have their respective columns. This occasion will depend on the case study to be completed. But in this case, we need a date and time in ISO 8601 format.
Not only can this be achieved using SQL queries with the built-in CONCAT function, but Tableau can also do this with the built-in functions provided by creating a new column.
What's the problem?
In this case, we will try to see how big the comparison is between transactions returned by men and women per quarter from 2018 to 2022. Then conclude which gender makes the majority of transaction returns.
Create transaction return date and time
Recall that our data set consists of several columns of time units. We must make this state into one column for the date and time. We will use the MAKEDATE function for dates, which will take three value arguments when used.
Ensure the order of input arguments is appropriate and must also be type integer yes. So the return date column will be like this:
As with time, in Tableau, we will use the MAKETIME function.
Thus the return time column will be created as follows:
Once you've successfully created the date and time columns, it's time to make all of them into a timestamp. This time we will use the MAKEDATETIME function.
And the column that we create becomes like this.
Transactions and returns, which is more?
Let's create a line chart representing the changes in these two metrics per successive quarter. So the steps taken are:
- Create a row in a new sheet with COUNT DISTINCT of total transactions returned and TOTAL quantity of transactions received.
- Compare the two values based on time with continuous units of quarters.
- Don't forget to change the two measurements in rows to dual axes, so they stand on the same Cartesian chart.
Do not be fooled
At first glance, the line chart shows that the returned transaction is greater than the entire transaction. This chart can present a bias for our audience and must be adjusted to show the percentage between the two line charts. The method :
- Create a new column named % of return, which results from the division between the total transactions returned and the complete transactions.
- Change the data type format to a percentage with a precision of one digit after a comma.
So that the trend of the returned transactions can be seen on this line chart.
So, is it a woman or a man?
The last step that needs to be done is to see the comparison between men and women, who often return their transactions. We can achieve this goal by giving a Marks Card in the color section of a Gender column consisting of Male and Female so that it becomes a line chart between the two sexes.
Look, it turns out that the female gender is the majority of customers who make transaction returns. This uniqueness certainly needs further analysis!
Top comments (1)
The stats are amazing Drift F1