Qlikview – 来自excel的数据

我有我每天填写的具体表,我需要从这张表创build条形图。

我的桌子是这样的:

![在这里输入图片描述

C,D,E,F列在一个月内呈现一周,我需要填写SmallPlace,BigPlace,All和Date的数据。 G,H,I,J列下周提供数据。

我需要加载这个excel在qlikview和

  • 制作有x轴列小图,BigPlace和行列,
  • 也需要可以按date过滤的图表,
  • 图表总计一天的总和,
  • 来自C,D,G,H列的所有smallPlace,BigPlace的图表。

我没有任何想法。 我可以像这样创build图表吗?或者我需要更改我的表格?

从数据的angular度来看,excel文件中的结构很难处理。 如果你对excel文件有控制权,我可以build议你把它改成容易加载的东西(不仅在QV中)

下面的脚本将加载数据,并将其转换为可用于构build图表更容易的东西。 你也可以从这里下载使用过的qvw

PS Im使用QV版本12.1

// Load only the first record to get the available column names Metadata: First 1 Load * From [C:\Users\Home\Documents\Book1.xlsx] (ooxml, embedded labels, table is Sheet1) ; // Get the total column names - 1 (will exclude the Day column let sColumnsCount = NoOfFields('Metadata') - 1; // How many iterations. 5 is the step let sStep = $(sColumnsCount) / 5; for i = 0 to $(sColumnsCount) - 1 step 5 // Get the column names for each iteration let sDay = FieldName( 1, 'Metadata' ); let sLocationField = FieldName( $(i) + 2, 'Metadata' ); let sSmallPlaceField = FieldName( $(i) + 3, 'Metadata' ); let sBigPlaceField = FieldName( $(i) + 4, 'Metadata' ); let sAllField = FieldName( $(i) + 5, 'Metadata' ); let sDateField = FieldName( $(i) + 6, 'Metadata' ); // Load only the colums from the iteration // and append it to the main table Data: Load $(sDay) as Day, $(sLocationField) as Location, $(sSmallPlaceField) as SmallPlace, $(sBigPlaceField) as BigPlace, //$(sAllField) as All, // <-- Dont think you need this $(sDateField) as Date FROM [C:\Users\Home\Documents\Book1.xlsx] (ooxml, embedded labels, table is Sheet1) Where lower( $(sLocationField) ) <> 'total' // <-- think that the Total values are not needed as well ; next Drop Table Metadata;