Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SUM Expression on qliksense

Hi

I'm struggling with to produce a chart using the SUM expression on qliksense. I have a table

User      Hours     Minutes

Victor     1               30

Jack          2               00

Victor     3               00

I'm trying to do a sum of all the users and it doesn't seem to be as simple as SUM(hours). Can anyone please help me with this expression?

Kind Regards

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Is hours is in number format or text format?

Try like this

Data:

LOAD

Num(Hours) AS Hours,

Num(Minutes) AS Minutes,

User

FROM DataSource;

Now use Sum(Hours)

Hope this helps you.

Regards,

jagan.

View solution in original post

9 Replies
sunny_talwar

What are you seeing when you do Sum(Hours) -> Make sure you are using the correct casing for hours fields (in QlikView and Qlik Sense Hours is different from hours)

Not applicable
Author

‌hi, I'm using a capital H for Hours. do you suggest I change all the headings to small letters In the the excel spreadsheet?

sunny_talwar

No you don't have to. I just wanted you to make sure that you are using the correct case. What output do you see when you do Sum(Hours)?

Not applicable
Author

Hi, I wanted to see the chart of the sum of hours each user has spent on a project

jagan
Luminary Alumni
Luminary Alumni

Hi,

Is hours is in number format or text format?

Try like this

Data:

LOAD

Num(Hours) AS Hours,

Num(Minutes) AS Minutes,

User

FROM DataSource;

Now use Sum(Hours)

Hope this helps you.

Regards,

jagan.

brijesh_fofadiy
Contributor III
Contributor III

Use MakeDate to do this.

e.g :

Qlikcommunity:

Load * Inline

[

User, THour, Minutes

AA, 1, 30

BB, 2, 00

CC, 3, 30

];

Qlikcommunity1:

Load *,

Hour(THour) as THourr,

Minute(Minutes) as Minutess,

MakeTime(THour,Minutes) as NewTime

Resident Qlikcommunity;

drop Table Qlikcommunity;

Thanks,

Brijesh

reddy-s
Master II
Master II

Hi,

try using this

num#(Hours) as Hours and then use sum(Hours) as the expression.

Thanks,

Sangram

Not applicable
Author

Hi do i change the hours title on the spreadsheet to the num#(hours)

reddy-s
Master II
Master II

Hi Victory Obi,

You don't have to change the title in the spread sheet.

I wont you to make use of num#() function on the Hours fields in the load statement. This will convert a string to number.

so use this:

load x,

       y,

       num#(Hours) as Hours

from [LIB:\\.....\..];

Thanks,

Sangram.