Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple sum/group by giving wrong results

Can someone give me a reason why the SumReadPassed column does not give me a correct result?

The Passed_both_num consists of only "0" and "1". Each Employee initials appear max. 4 times - but still my sum is returning values from 1 to 45 (should not be possible)

Anything wrong with my Group By / Sum script???

TABLE:

     LOAD [Employee ID],
    
Name,
    
Num#([Passed_both]) as Passed_both_num,
    
[SOP ID],
    
[SOP Task Code],
    
[SOP Revision],
    
[SOP Due Date],
    
[SOP Sign Date],
    
[SOP Taken On Time],
    
[SOP Status],
    
[Test ID]

FROM
\\BE_training.qvd
(
qvd);

SUM:

LOAD[Employee ID],

SUM (Passed_both_num) AS SumReadPassed

RESIDENT
TABLE

GROUP BY[Employee ID];

COUNT:

LOAD[Employee ID],

TEXTCOUNT (DISTINCT ([SOP ID])) AS CountSOPID

RESIDENT
TABLE

GROUP BY[Employee ID];   

4 Replies
Sokkorn
Master
Master

Hi gia_qlikview,

Just give script a try

SUM:
NoConcatenate

LOAD[Employee ID],

SUM (Passed_both_num) AS SumReadPassed

RESIDENT
TABLE

GROUP BY[Employee ID];

Or

SUM:
NoConcatenate

LOAD[Employee ID],

SUM (Distinct Passed_both_num) AS SumReadPassed

RESIDENT
TABLE

GROUP BY[Employee ID];

Regards,

Sokkorn

anandathome
Creator
Creator

I don't think you explicitly need to convert [Passed_both] to Num.

Simple sum and group by would work.

In the table viewer, right click on "Sum" table and view data.

This should give you a clear view, where it is going wrong.

Not applicable
Author

qvd file was incorrect.. but thanks anyway!

Sokkorn
Master
Master

Hi gia_qlikview,

That a problem. Great you can figure it out.

Cheer!!!

Sokkorn