簡體   English   中英

我們如何在Spotfire中轉換表並將列名保持為rownames?

[英]How can we transpose a Table in Spotfire with keeping columnames as rownames?

我的樣本數據如下。 但是原始數據非常大,所以我不能硬編碼。

+-----+-------+---------+
| IDN | NAME  |  VALUE  |
+-----+-------+---------+
| 121 | test  | 1254.25 |
| 152 | testa | 1585.25 |
| 587 | testb | 5878.69 |
+-----+-------+---------+

轉置功能后: -

+---------+---------+---------+
|   121   |   152   |   587   |
+---------+---------+---------+
| test    | testa   | testb   |
| 1254.25 | 1585.25 | 5878.69 |
+---------+---------+---------+

預期:-

+-------+---------+---------+---------+
|  IDN  |   121   |   152   |   587   |
+-------+---------+---------+---------+
| NAME  | test    | testa   | testb   |
| VALUE | 1254.25 | 1585.25 | 5878.69 |
+-------+---------+---------+---------+

我使用t()函數是spotfire但在結果數據表中我錯過了作為rownames的列名。 反正有沒有

您可以使用UnPivot和Pivot執行此操作。

  • 插入>轉換
  • 使用下面的設置添加Unpivot並點擊確定
  • 使用以下設置添加數據透視表
  • 使用“編輯”>“列”屬性更改列1的列名稱

UNPIVOT

樞

這是數據表設置

    Add the transformations:
        a. Unpivot
            Add columns to pass through:
                IDN
            Add columns to transform:
                NAME
                VALUE
            Category column name: Column
            Select category column data type: String
            Value column name: Value
            Select value column data type: String
            Select 'Include null values'
        b. Pivot
            Choose row identifiers:
                Column
            Choose value columns and aggregation methods:
                Concatenate(Value)
            Choose column titles:
                IDN
            Column naming pattern: %M(%V) for %C

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM