将数据从列中转换为qlikview的行

发布于 2025-02-07 17:29:34 字数 940 浏览 2 评论 0原文

我有XLSX表,该表每月都有数据。 I want to convert it to rows while I load it to QlikView

First NameLast NameHome OwnerMortgage44562445934462144652
AFSFDYY343434876887788878878
DGDKJJHKYN5454454454574878
FDQETERTERNN786767878974546547787
RTEYRTYZYN7863454547875744
SASTRGFVNN67645446512154878

I have the xlsx sheet which has data for every month in the columns. I want to convert it to rows while I load it to QlikView

First NameLast NameHome OwnerMortgage44562445934462144652
AFSFDYY343434876887788878878
DGDKJJHKYN5454454454574878
FDQETERTERNN786767878974546547787
RTEYRTYZYN7863454547875744
SASTRGFVNN67645446512154878

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时模样 2025-02-14 17:29:34

在这种情况下,您可以使用 crosstable 负载。

从文档中:

crosstable前缀用于将横桌变成直桌,即,一个带有许多列的宽表变成了一个高桌,将列标题放在单个属性列中。

在您的情况下,我们可以使用这样的脚本:

Data:
CrossTable([Month], [Value], 4)
LOAD 
  [First Name], 
  [Last Name], 
  [Home Owner], 
  Mortgage, 
  [44562], 
  [44593], 
  [44621], 
  [44652]
FROM
  [C:\Users\USER\Documents\data.xlsx]
  (ooxml, embedded labels, table is Sheet1)
;

一旦脚本重新加载,结果表将是:

“

crosstable(月,值,4)很重要。括号中的值指出:在4第4列之后,将顶部行(标头)移动为列,并将新列命名value(您可以在屏幕截图中看到新的 value 列)。 value是构成名称,可以将其命名为任何您想要的。

In this case you can use CrossTable load.

From the documentation:

The crosstable prefix is used to turn a cross table into a straight table, that is, a wide table with many columns is turned into a tall table, with the column headings being placed into a single attribute column.

In your case we can have script like this:

Data:
CrossTable([Month], [Value], 4)
LOAD 
  [First Name], 
  [Last Name], 
  [Home Owner], 
  Mortgage, 
  [44562], 
  [44593], 
  [44621], 
  [44652]
FROM
  [C:\Users\USER\Documents\data.xlsx]
  (ooxml, embedded labels, table is Sheet1)
;

Once the script the is reloaded the resulted table will be:

data preview

CrossTable(Month, Value, 4) is the important bit. The values in the the brackets are stating that: After the 4th column, move the top row (header) as column and name the new column Month, name the values against it Value (you can see the new Month and Value columns in the screenshot). Month and Value are made-up names and the can be named whatever you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文