Skip to main content

欠損値の値を表示したい(I want to display the value of a missing value)統計資料で「あり」「なし」の表を作成しました。

あるデータに「あり」のデータがありません。

表としては「あり」「なし」を表記したく思います。

どのように制御すればよいでしょうか。

ご教示お願いします。

---------------------------------

I made a table of "Yes" and "No" in the statistical data.

There is no "Yes" data in some data.

I would like to indicate "yes" and "no" as a table.

How should I control it?

Please teach me.

 

5 answers
  1. Mar 23, 2022, 2:33 AM

    @TOSHIHIEO EBATA​ Hi Toshihieo

     

    Tableau Prep is a great tool you can use to clean and shape data as well as apply some calculations upfront before developing your dashboards in Tableau Desktop.

     

    For this case, I will explain how new rows can be inserted using Tableau Prep. For the purpose of this exercise, I have created a mock source data. (Both the workbook and the Mock Source Data will be attached to this response).

     

    Step 1

    First, we identify how many rows are missing and which rows are in need of being added.

     

    @TOSHIHIEO EBATA​ Hi Toshihieo Tableau Prep is a great tool you can use to clean and shape data as well as apply some calculations upfront before developing your dashboards in Tableau Desktop. 

    Step 2

    Launch Tableau Prep Builder and connect to the Source Data.

    Image 02 

    Step 3

    Add a flow object called "New Rows" by first clicking on the small + sign next to the data source object in the work space.

     

    Image 03 

    Follow the instructions in the above image in step 3, while taking note of the following.

     

    Under the Select a field picklist in the menu, it auto detects field or fields whose values will be used as a reference for adding new rows. In this example, it auto detected [Count]. So we can only select [Count] in this instance.

     

    In the section on adjusting the number of rows, this is controlled by the step size of the increments in the [Count] field. When we set this step to 1, you will see that the total number of rows is for every incremental value in between the min [Count] value and max [Count] values which are 10 and 30 respectively. That is why you see 11, 12, 13...29 as these are all incremented by 1.

     

    If we change the setting to a different step size the number of new rows will decrease.

     

    Since our example needs 4 additional rows, we will adjust the step size until we end up with 4 new rows. This number happens to be 4 in our example.

     

    The 4 new rows added now carry [Count] values of 14, 18, 24, 28. Do not worry too much about these numbers as they are not going to be influencing your actual output. These numbers are only going to be used as a reference.

     

    Also, in the picklist called "What values should your new rows have?" we will select an option of "Copy from previous row". What this does is it populates all the other columns [Type], [Age Group], [Response] with the same values from its previous rows. If you select null or zero option, then new rows will all be just null values except for the [Count] field.

     

    Image 04 

    The above image shows the difference between these two picklist options.

     

    Step 4

    Create a clean step and add new calculated fields to change the values for the 4 newly added rows.

    Image 05 

    What we are doing with these 4 calculated fields is creating a new set of the 4 columns with new names.

    1. Revised Type (Derived from [Type])
    2. Revised Age Group (Derived from [Age Group])
    3. Revised Response (Derived from [Response])
    4. Revised Count (Derived from [Count])

     

    The main objective here is to assign correct values to those 4 newly added rows.

     

    Step 5

    Remove the original 4 columns ([Type],[Age Group],[Response],[Count])

     

    To remove the original columns, click on the small + sign next to the current "Clean Step" object and select another "Clean Step".

     

    Image 06 

    Step 6

    Rename the 4 new columns whose names start with "Revised".

     

    Then add an Output module and select the location for saving the .hyper file.

     

    Then click on Run Flow button to extract the output of the flow. The .hyper file can then be opened from the Tableau Desktop.

     

    Image 07 

    I have attached the Tableau Prep flow.

     

    I hope this helps.

0/9000