1. Buzzfeed recently asked Midjourney to draw images of people in 50 US states.  So the AI drawing tool created 50 images of couples that represent its perception of the people in each state.

    I just put the images into a tiled map in Tableau. Each image is added as a background in each tile.

    And also I added Viz-in-tooltips to enlarge an image to look at more details.
    Feel free to download the workbook and explore it.

    1

    View comments

  2. The folks at Business Expert had a brilliant idea. They asked AI's perception on UK banks as a dog. I am inspired to do the same on US banks.

    ChatGPT is asked to confess its perceptions on top US banks as a dog. Then Midjourney is tasked to generate the images. Check out what dog is matched to your favorite bank.


    All are put together into a single-sheet Tableau dashboard. Feel free to check it out.

    0

    Add a comment

  3. Through my previous post on the new Sankey chart type, I got in touch with Wilson, the product manager leading the development of this new chart type. I made some comments on creating multi-level Sankey via cascading of single Sankey's. He told me it can be done already by dropping more dimensions into the Level card. How could I overlook that functionality when exploring? Maybe it's because there are only two level bars in the Level card icon? Or did I have a fixation on building multi-level Sankey via a Lego approach?

    Oh well, I am really happy that we can build multi-level Sankey charts with a few drag and drops!

    Below are a few varieties of multi-level Sankey chart built with the new chart type.

    1.Multi-Level Sankey via Chart Type

    We only need 5 drag-n-drops to create this chart: 4 dimensions and 1 measure.

    2.Multi-Level Sankey with Level Padding

    In the Level card, we can set the option to add vertical space between members of a level dimension. This is called Level Padding.

    3.Multi-Level Sankey without Level Bars

    In the Level card, we can set the option to hide/minimize the vertical bars.

    4.Multi-Level Sankey Showing Labels when Selected or Highlighted

    We can set the option in the Label card to show labels on links that are selected or higlighted.

    Comments

    Overall, the creation of multi-level Sankey chart is a breeze.

    My only observations are as follows.
    • Can we have more options in setting the colors of links and bars? 
    • Can we support Funnel chart through this chart type? People ask me about Funnel chart often.
    • In my experience, one decimal percentage is enough.
    The above chart can be viewed here. And it can be explored in web edit. The workbook can't be downloaded because it's a pilot program.

    0

    Add a comment

  4. As an enthusiastic user of Sankey charts, I am excited to learn that a Sankey chart type is being piloted in Tableau Public (Web Edit only). I wrote about Sankey chart design in multiple posts. Sankey chart may appear in different forms depending on applications. 

    I played a little with it just to evaluate it. Here are my initial findings and comments.

    1. The basic Sankey

    I can quickly create a Sankey with 2 dimensions and 1 measure. This is great! 

    I noticed that two new marks cards are being used: Level and Link. The two dimensions are placed in Level card and the one measure is placed in Link card.

    Comments:

    - The text labels are showing by default and not editable. I understand the design choice. More details can be put in the tooltips. Note that the measure is showing in percentage and not the measure itself. That's fine in Sankey. But I hope we can format the percentage. Currently we can't.

    - The Label card is no longer the same as in other chart types. The labels have option to show on links/branches that are selected or highlighted or both.

    - The Color card provides options to a number of color palettes. We as user can't assign color to each member of a dimension. It's pretty rigid. The coloring of the links follows that of the left level/dimension with a lower opacity. I wonder if we should have option to use the colors of either left or right level/dimension for those of the links.

    2. Sankey with Level Padding

    We can add vertical spaces between the members in sidebars. This is what we have been doing when creating Sankey charts. The option is in the Level card as shown below. This is being called Level Padding. The padding size can be adjusted appropriately. 

    3. Sankey without Sidebars

    In the Level card, we can minimize the sidebars by adjusting the Level Width.

    Comment:

    I would ask that we have the option to minimize/hide either of the sidebars. The need arises in the building of multi-level Sankey chart, where we cascade single Sankey's. Then one of the two sidebars in a single Sankey would be redundant. We need to be able to hide/minimize it. 

    This way, we will expand the utility of the Sankey chart type to building multi-level Sankey chart.

    4. Sankey Label Showing when Selected or Highlighted

    In the Label Card, we have the option to only show labels when a branch is selected or highlighted. This is neat, saving some effort of creating action filters.

    5. Further expectations

    Funnel chart is an important chart. It can be derived from multi-level Sankey chart. This can be done with a few more hiding options and cascading. The hiding is for a subset of members in a sidebar level/dimension.

    6. Summary

    Overall, the new Sankey chart type is easy to use. I am very happy about its pilot trial.

    With a few additional tweaks, I think it can be applied to a wider area of use cases such as multi-level Sankey chart and Funnel chart.

    The above example charts can be viewed on Tableau Public and explored in Web Edit. But you can not download it because the pilot is in web edit only.

    0

    Add a comment


  5. Just came across a report by Reuters on USA-China gap widens between respective internet giantsThe report includes a text table. The caption says the table columns can be sorted. But it is a static image. (They retracted the table after I reported the issue.)
    It picked my interest. I therefore created a Tableau version with column-wise horizontal bar charts and column sort. I would like to show that we can have a more visual way of displaying tables. And I still included a text mode just for the comparison. Or if the user wishes, he can switch between text and visual modes.

    Feel free to download the workbook and look into the details.

    The key steps in this design are:
    1. Dual axis for each column to show both bars and numbers. This way both the company names and numbers are well aligned.
    2. Use parameterized metric for column sorting.
    3. Use parameter action for selecting the column sort. Each column header is a sheet. It includes a number as a dimension for assigning to the parameter.
    4. Deselect the column header after clicking.
    The deselect method is based on a technique introduced by Yuri Val

    That's how we can visualize a cross-tab table with column sort.


    1

    View comments

  6. In the process of creating a dashboard on the US Travel Advisory 2023, I found some mismatches in a few regions in two countries.

    Gaza Strip

    One is Gaza Strip in Palestinian Territories. In the latter, there are two regions: Gaza Strip and West Bank. However in Tableau's map, the corresponding polygon to Gaza Strip doesn't show up. I later found out that the region is named "Palestinian Territories" which is the same as the country. So the pair country/province is like "Palestinian Territories/Palestinian Territories". This gives me the correct polygon for Gaza Strip. I noticed that Gaza is a city within Gaza Strip and also the name of cities in multiple countries.

    I expected the correct pairing is "Palestinian Territories/Gaza Strip".  I checked openstreet map whose map is used in Tableau. In that map, the region is called Gaza Strip.

    Mexico City

    Mexico City as the capital is like Washington DC and is regarded as a state in Mexico. In mapping Mexico at the state level, I found that Mexico City is not showing up. After some research, I found that I need to use "Distrito Federal" for it to show up. In Britannica, it is stated that Mexico City is officially equivalent to the "Distrito Federal". 

    I expected that Mexico City or CDMX work as well as Distrito Federal. It seems that CDMX is replacing Distrito Federal as the official name of the capital.

    Conclusion

    I hope the above can be fixed to reduce the confusion by Tableau users.

    Below's the US Department of State's Travel Advisories visualized in Tableau. The interactive version is here. It's dated on 3/14/2023. This is a dynamic map which needs to be updated all the time. Please refer to the US Department site for the latest.




    0

    Add a comment

  7. This is a follow up post to Fiscal Calendar Calculations Cheatsheet for Tableau.

    Excel is a very important tool for data analysis and calculations. It's also an important data repository for Tableau. Some of the calculations can be made in Excel before the data is loaded into Tableau or other tools.

    So here we are going to show the conversion from a regular date to a week-based financial calendar date, via Excel formula. We still use Apple's 5-4-4 Fiscal Calendar as an example.

    The First Week of a Fiscal Year

    It is the week that includes October 1st which is an Anchor Date. From the first week, we can determine the Fiscal Year.

    Fiscal Year

    Here is the formula for calculating Fiscal Year.
    Note that B2-WEEKDAY(B2)+1 is the first day of the fiscal year. From this day on, the new fiscal year starts.

    The First Day of the Fiscal Year

    In the above Fiscal Year calculation, we used B2-WEEKDAY(B2)+1 to get the first day of the week that includes date B2. This is equivalent to DATETRUNC('week', B2) function in Tableau.

    Leap Fiscal Year

    A common fiscal year has 52 weeks and a leap fiscal year has 53 weeks. We will use this property to determine if a fiscal year is a leap year or not.
    This formula allows us to get the total number of weeks between the start dates of two consecutive fiscal years.

    The formula can be simplified a little: (E2-WEEKDAY(E2)-(D2-WEEKDAY(D2))/7

    The logic test can be written as E2-WEEKDAY(E2)-(D2-WEEKDAY(D2)=371. If true, then it is a leap fiscal year.

    Fiscal Week

    The fiscal week of a common date is its distance to the start week of the fiscal year.

    Fiscal Month/Period

    In a common fiscal year, we will have 5-4-4 weeks for each of the 4 fiscal quarters. In a leap fiscal year, we will have 5-4-5 weeks in the first fiscal quarter. That is, the 3rd fiscal month/period will have 5 weeks in a leap fiscal year instead of 4.

    Here is the formula for calculating fiscal month/period

    Fiscal Quarter

    It's easy to create the formula for getting fiscal quarters from fiscal months.

    Demo File for Download

    We have an Excel file for you to download (Click link and open it in Google spreadsheet. Go to File and click Download.) It has all the above formulas and all the fiscal years in the next 1000 years. Feel free to use it in your data analysis.

    Conclusion

    With the above formulas, we save the dependency on a database table for converting a common date to fiscal date. The above example is based on a 5-4-4 week-based fiscal calendar. It may not match exactly your fiscal calendar. Nonetheless it may give you some ideas for creating your conversion formulas.

    Feel free to leave comments or contact me at @aleksoft at twitter.
    0

    Add a comment

  8. Week-based calendars are used in many companies as their fiscal calendars. The total weeks in a fiscal year is 52 weeks, that is, 364 days. Each quarter has 13 weeks. There are 3 varieties of 13 weeks: 5-4-4, 4-5-4 and 4-4-5 weeks per quarter. In leap years, there are 53 weeks or 371 days. IRS has created special code for the 52-53-week fiscal years.

    Each company's week-based fiscal calendar will differ in 4 ways:

    - define the 13-week quarter as 5-4-4, 4-5-4 or 4-4-5
    - define its own start week 
    - define its own way of placing the leap week
    - define the first day of week as Sunday, Monday etc.

    Please refer to each company's official fiscal calendar for the exact design. This post is just a reference for the conversion of a common date to fiscal dates under given rules.

    Apple's Fiscal Calendar is widely disseminated on the web. Here we try to clarify some of the misunderstandings and provide calculation assistance in Tableau for analyzing time series based on the 5-4-4 format. We will use Apple's fiscal calendar as an example below.

    Common Fiscal Year

    In a common year, it's a 52-week year which has 52x7 = 364 days.

    A year has 4 quarters and each quarter has 3 fiscal periods/months. 

    Each quarter has 13 weeks.

    At Apple, the first period of a quarter has 5 weeks and the other two have 4 weeks each. It's thus called a 5-4-4 calendar.

    First Week of a Fiscal Year

    For a week-based calendar, it is very important to understand the definition of its first week. Each company may have a different definition of the first week.

    For Apple's fiscal calendar, its first week is the one that always includes October 1st. This week is the first one of the next fiscal year. For example, the week that includes 10/1/2022 is the first week of fiscal year 2023.

    First Day of a Week

    In Apple's fiscal calendar it's always a Sunday. There may be other conventions where we need to change the following calculations.

    Leap Rule

    Every 6 years or so, there will be a leap fiscal year. 

    A leap fiscal year will have 53 weeks, one more week than the common fiscal year. 

    The cause of the leap fiscal year is as follows:

    - A common fiscal year has 364 days while a common calendar year has 365 days. It is 1 day less than the calendar year. It seems that every 7 years, we need to add a week to the common fiscal year to realign the starting dates of fiscal years. But the 7-year frequency is broken by the leap calendar years because a calendar year doesn't always have 365 days. This makes it a lot less predictable when guessing which year is a leap year.

    - A calendar year has its own leap year which has 366 days. This happens on every 4 years on the years divisible by 4 and excluding the years that can be divided by 100 but can't be divided by 400.   

    The leap years in the next 100 years and the gaps in between.

    Leap Week

    In a leap fiscal year, there will be an extra week or a leap week. Where to place it depends on the company. In Apple's fiscal calendar, it's added in the third fiscal month which becomes a 5-week month during a leap fiscal year. That is, we insert the leap week after the 13th week of the fiscal year. Or the 14th week of a leap fiscal year is the leap week.

    Placement of the Leap Week

    We have an extra week in a leap fiscal year. It is appended to the end of the first fiscal quarter or the 3rd fiscal month/period. Thus, the first fiscal quarter, instead of 5-4-4 quarter and having 13 weeks, it becomes 5-4-5 quarter and having 14 weeks.

    How to Determine if a Fiscal Year is a Leap Year?

    This is easy. Just find out if October 1st in two consecutive years has a gap of 53 or 52 weeks. If 53 weeks, it is a leap year for sure.  So, use this logical formula:

    The First Day of a Fiscal Year

    The Sunday of the first week is the first day of the fiscal year.

    In Tableau formula, we can easily derive the first day of a fiscal year. For example for the fiscal year 2023, the first day is:

    DATETRUNC('week', MAKEDATE(FiscYear-1,10,1))

    Some says the first day is always the last Sunday of September. This is not exact. It's only about 6/7 correct. It's the Sunday within Sept 25th - Oct 1st. 

    The Last Day of a Fiscal Year

    It's actually the last Saturday in September. For any FiscYear, the last day is the first day of the next FiscYear minus one.

    DATETRUNC('week', MAKEDATE(FiscYear,10,1))-1

    Convert a Date to Fiscal Year/Quarter/Month/Week?

    Here are the Tableau formula we can use to convert a regular date to its corresponding fiscal date. Note that they are dependent on the ones above them.

    - What fiscal year is it in? We got FiscYear which is dependent on Order Date alone.

    - What fiscal week is it in? We got FiscWeek which is dependent on Order Date and FiscYear.

    - What fiscal month (period) is it in? We got FiscMonth which is dependent on FiscWeek and Leap Year T|F. (Credit Steve Fenn

    - What fiscal quarter is it in? We got FiscQuarter which is dependent on FiscMonth.

    Conclusion

    Note that each company may have its own way of defining its week-based fiscal calendar. Hope that this post can give you some ideas for deriving your own specific formula.

    Feel free to download this workbook and copy over the formula if you wish. Contact @aleksoft if questions. 

    0

    Add a comment

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.