Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
farolito20
Contributor III
Contributor III

sum()

What's the meaning of sum() function in this script

Temp1:

Load

          CustomerNumber,

          Sum(1)          as TempId

Resident DimTemporary2

Group By CustomerNumber;

Drop Field TempId;

Left Join (Temp1)

Load

          CustomerNumber,

          Rowno()          as TempId

Resident Temp1;

1 Solution

Accepted Solutions
MayilVahanan

HI

Its count the customer count and display the result.

LOAD *,Date(Date#(Date,'MM/DD/YYYY'),'DD/MM/YYYY') as DateField INLINE [

    ID, Date, Status,Values

    A, 12/4/2012, Docs Received,1

    A, 12/3/2012, Docs Sent,2

    A, 12/2/2012, Docs Requested,3

    B, 12/2/2012, Docs Sent,4

    B, 11/1/2012, Docs Requested,5

    C, 12/4/2012, Docs Requested,6

    D, 12/3/2012, Docs Requested,7

];

Load Sum(1) as IDCount,ID Resident Test Group by ID;

In this, For ID - A, its IDCount - 3

     B,2

     C,1

     D,1

But why you remove that field?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

HI

Its count the customer count and display the result.

LOAD *,Date(Date#(Date,'MM/DD/YYYY'),'DD/MM/YYYY') as DateField INLINE [

    ID, Date, Status,Values

    A, 12/4/2012, Docs Received,1

    A, 12/3/2012, Docs Sent,2

    A, 12/2/2012, Docs Requested,3

    B, 12/2/2012, Docs Sent,4

    B, 11/1/2012, Docs Requested,5

    C, 12/4/2012, Docs Requested,6

    D, 12/3/2012, Docs Requested,7

];

Load Sum(1) as IDCount,ID Resident Test Group by ID;

In this, For ID - A, its IDCount - 3

     B,2

     C,1

     D,1

But why you remove that field?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
farolito20
Contributor III
Contributor III
Author

Thanks

farolito20
Contributor III
Contributor III
Author

And what about whit the left join in the same table loaded?

CELAMBARASAN
Partner - Champion
Partner - Champion

It joins the RowNo() field generated to the rtable loaded above based on the Customer number.