Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
MVP
MVP

Re: SUM Expression on qliksense

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.

9 Replies
MVP
MVP

Re: SUM Expression on qliksense

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

Re: SUM Expression on qliksense

‌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?

MVP
MVP

Re: SUM Expression on qliksense

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

Re: SUM Expression on qliksense

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

MVP
MVP

Re: SUM Expression on qliksense

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
New Contributor III

Re: SUM Expression on qliksense

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

reddys310
Honored Contributor II

Re: SUM Expression on qliksense

Hi,

try using this

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

Thanks,

Sangram

Not applicable

Re: SUM Expression on qliksense

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

reddys310
Honored Contributor II

Re: SUM Expression on qliksense

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.