2017-05-01 9 views
0

私は毎日、私はこのテーブルから棒グラフを作成する必要がある特定のテーブルを持っている。月にQlikview - data from excel

![enter image description here

が列C、D、E、F現在一週間と私はSmallPlace、BigPlaceからのデータを、すべてと日付を記入する必要があります。

私のテーブルは、このようにloook。列G、H、I、Jは来週データとともに表示されます。

私はQlikViewをこのExcelをロードし

    日付でフィルタリングすることができ、X軸カラムsmallPlace、BigPlaceと 行の和を有する
  • メイクチャート、
  • もチャートを必要とする、
  • する必要
  • 日の合計合計のグラフ、
  • すべてのsmallPlaceのチャート、C、D、G、HのBigPlace。

私はどんな考えを持っていません。このような表を持つチャートを作成できますか、テーブルを変更する必要がありますか? Excelファイル内のデータの観点から

答えて

1

構造を処理することは困難です。 Excelファイルを管理している場合は、読み込みが容易なもの(QVだけでなく)に変更することをお勧めします。

以下のスクリプトはデータを読み込んで、はるかに簡単にチャートを作成するために使用されます。また、使用したqvwをダウンロードすることもできます。here

P.S.私は、コードを実行するとイムは、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; 
+0

を使用して、私得たエラー:構文エラー、不足しているFROM /紛失: データ:デイとして ロード 日、場所など SmallPlace1、SmallPlaceとして BigPlace1、 ALL1 [:\ユーザーはLoc.xlsx \ C](OOXML、埋め込まれたラベルを、表がシート1である) 下(SmallPlace1)<> 'の合計は、' それはのように見えます BigPlace、 すべてのように日付1、 FROM日 のように変数sLocationFieldの値をm SmallPlace1 ????そしてデータは、手順5を入れて、なぜ私は理解していない – dev

+0

空のですか?このステップ5は何を意味しますか? – dev

+0

私はスクリーンショットの1つのフォームと同じエクセルを作り直そうとしました。おそらく、私は何かを見逃したかもしれません。サンプルデータをどこかにアップロードすることができれば、それを調べることができます。 –