Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Average hours per week

Hi All

I am new to qlikview, could you please help me in calculating Number of hours per week .

Pls see the attached excel file with pivot table

9 Replies

Re: Average hours per week

Is this an extract from QlikView or is this the way your data is structured?

jyothish8807
Honored Contributor II

Re: Average hours per week

Hi Ganesh,

PFA app. Hope it will be helpful.

CrossTable(Week, Data)

LOAD [Row Labels],

     [1],

     [2],

     [3],

     [4],

     [5],

     [6],

     [7],

     [8],

     [9],

     [10],

     [11],

     [12],

     [13],

     [14],

     [15],

     [16],

     [17],

     [18],

     [19],

     [20],

     [21],

     [22],

     [23],

     [24],

     [25],

     [26],

     [27],

     [28],

     [29],

     [30],

     [31],

     [32],

     [33],

     [34],

     [35],

     [36],

     [37],

     [38],

     [39],

     [40],

     [41],

     [42],

     [43],

     [44],

     [45],

     [46],

     [47],

     [48],

     [Week Number],

     [(blank)],

     [Grand Total]

FROM

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Regards

KC

Best Regards,
KC
Not applicable

Re: Average hours per week

HI sir, Thanks for quick reply

That is my data in excel file

jyothish8807
Honored Contributor II

Re: Average hours per week

You can remove from the script, its just an sample.

[Week Number],

     [(blank)],

     [Grand Total]

Regards

KC

Best Regards,
KC
Not applicable

Re: Average hours per week

@KC

Hi Sir, Thanks for the response

could you please see the qvw file i have attached,

I am unable to grasp that i need from your file

Re: Average hours per week

Data:

CrossTable(WeekNumber1, Hours1,1)

LOAD [Row Labels] as Employee,

    [1.000000],

    [2.000000],

    [3.000000],

    [4.000000],

    [5.000000],

    [6.000000],

    [7.000000],

    [8.000000],

    [9.000000],

    [10.000000],

    [11.000000],

    [12.000000],

    [13.000000],

    [14.000000],

    [15.000000],

    [16.000000],

    [17.000000],

    [18.000000],

    [19.000000],

    [20.000000],

    [21.000000],

    [22.000000],

    [23.000000],

    [24.000000],

    [25.000000],

    [26.000000],

    [27.000000],

    [28.000000],

    [29.000000],

    [30.000000],

    [31.000000],

    [32.000000],

    [33.000000],

    [34.000000],

    [35.000000],

    [36.000000],

    [37.000000],

    [38.000000],

    [39.000000],

    [40.000000],

    [41.000000],

    [42.000000],

    [43.000000],

    [44.000000],

    [45.000000],

    [46.000000],

    [47.000000],

    [48.000000]

FROM

(ooxml, embedded labels, header is 1 lines, table is Sheet1, filters(

Remove(Row, Pos(Top, 30)),

Remove(Row, Pos(Top, 29))

));

New:

NoConcatenate

LOAD Employee,

floor(trim(WeekNumber1)) as WeekNumber,

floor(trim(Hours1)) as Hours

Resident Data;

DROP Table Data;




jyothish8807
Honored Contributor II

Re: Average hours per week

Hi Ganesh,

Which sheet do you want to load in QV ? I can see you are using other 2 sheets right now.

Regards

KC

Best Regards,
KC
Not applicable

Re: Average hours per week

Hi sir

Problem solved.

Thanks for the responses

oknotsen
Honored Contributor III

Re: Average hours per week

If your question is answered, please flag a Correct Answer and optionally one or more Helpful Answers to "close" the topic.

May you live in interesting times!
Community Browser