Tableau Prep Things

by Ozlem Sigbeku

Today has been a Tableau Prep exercise filled day with Jenny, the infamous voice behind Preppin' Data and the author of many a Tableau Prep challenge. I may have stumbled around a bit, but I learnt a thing of two. And it must be your lucky day because I will be explaining those very things to you!

Thing 1: Converting Date Fields (Fiscal Edition)

Let's say we have a nicely formatted date field we'd like change into fiscal years, and fiscal quarters. It may be wise to duplicate a date field if it will be used again later as a conversion will not create a new field but overwrite the existing field.

Figure 1

Tableau Prep allows a user to make changes to a date field by right clicking the field or by clicking the ellipsis on the right side of the field box (1. in image), and selecting 'Convert Dates' (2.). There are several conversion options. For our example, we would choose 'Custom Fiscal Year'; the last option in that list. Clicking that option will return the following pop-up:

Figure 2

For fiscal years, 'Convert dates' gives options for either year, quarter, month and week and will return the number for whichever date type selected. So, for 'Year Number' the fiscal year of the date will be returned. The 'Fiscal year start' is the month which the new fiscal year starts with. As an example, in the UK, the fiscal years starts in April.

What if you are extremely fiscally interested and want fiscal years and quarters? Well, you can do that in a following step. Again, it may be wise to duplicate a date field before following the steps to convert the duplicated date field. Then instead of selecting 'Year Number', select 'Quarter Number', using the same fiscal year start.

Now you know how to convert dates.

Thing 2: Generate Rows

From what I have heard, this step is new for Tableau Prep 2022.2.1. How exciting! If dates between a start and an end date needed to be created, a generate rows step could be used. To 'How do you want to add new rows?' the 'Value ranges from two fields' is selected but if there was only one field we a set number of values that needed to be generated. But as contracts have different lengths, I have used contract start and end dates (see red and green boxes below). Then (in blue), the increment values can be configured.

Figure 3

Now you are an expert in generating rows.

Thing 3: Rank

We all love to rank things. I would rank my own family if I could. But, I must settle with ranking in Tableau Prep.

Clicking the ellipsis on the top right of the field to be rank will give the following menu. Rank resides in the 'Create Calculated Field' option.

Figure 4

The rank can be grouped by another field, if needed. As below.

Figure 5

In the field I wanted to rank, there were duplicates. To ensure that the rank doesn't count the duplicates in the field being ranked, the order by configuration must be changed from 'Rank' to 'Dense Rank'.

Figure 6

And in usual ranking fashion, the order (descending/ascending) can also be changed.

Now you know how to rank.

At this point, you're basically a Tableau Prep expert. Stay tuned for more Tableau Prep things.

TLDR: A break-down of converting dates, generating rows and ranking in Tableau Prep. Read the full version to become an expert.

1 mins read

Wed 31 Aug 2022

2 mins read

Tue 03 Jan 2023

Mon 06 Jun 2022