Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlikview script

Guys,

I have a date field by month wise having worked hours for some employees in excel sheet. I want to take the worked hours for each employee by month wise. But here a single date can have multiple rows or values in excel. so how to use group by in script for month wise? plz help me..Screenshot_12.png

9 Replies
Colin-Albert

Your filed is holding a time value so you are getting each unique datetime value rather than each date.

Use FLOOR() to round the date to an integer and get a single value in your load script.

Use something like  date(floor(sheet_date)) as sheet_date.

You can also use the month() or monthname() functions to extract the month or year & month.

Anonymous
Not applicable
Author

But I'm having same time for all the dates, Colin

maxgro
MVP
MVP

could you post some rows of your excel?

Colin-Albert

How many values does a listbox in your Qlik app on the date field show?

What other fields are in your export? - Other fields may be causing the multiple values to be shown.

Anonymous
Not applicable
Author

I want to group the hours of an employee by month wise, but it should not take distinct dates, it should include all the dates.

Anonymous
Not applicable
Author

Screenshot_13.png

Colin-Albert

do not include the timesheet id in your table this is causing the export to have each row rather than the sum by month.

Why don't you create the chart directly in QlikView? Use a Chart object  with proj_id and monthname(sheetdate) as dimensions and use sum(worked_hours) as your expression. It looks like you are using a table object rather than a Straight Table chart.

kamielrajaram
Creator III
Creator III

Hi,

Why not add a month and year column to your table.

Year(sheet_date),

Month(sheet_date)

Then add year and month in your dimension and sum(hours_worked)

Kind Regards

Kamiel

maxgro
MVP
MVP

I think you can use a chart with

calculated dimension           MonthStart(sheet_date)

dimension                           employee

expression                          sum(worked_houes)