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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

sum in different items in the same row

Hi,

I have a pivot table with many rows and colums. The first one has a list of products, the second one has date for each specific product an d the third column has valus in format money. What I need to do? I need to sum. Item 1 of the first product with the item 1 of the second product. Then a new row would be Item 2 of the first product with the item 2 of the second product.

Thanks!

8 Replies
Sokkorn
Master
Master

Hi,

I'm not sure it can be done by chart. But let try via below script

[Data]:

LOAD * INLINE [

Product    ,    LeadTime    ,    Value

A    ,    61 - 90 Days    ,    10000

A    ,    91 - 120 Days    ,    5000

A    ,    121 + Days    ,    12000

A    ,    Seriously Past Due    ,    4000

B    ,    61 - 90 Days    ,    15000

B    ,    91 - 120 Days    ,    8000

B    ,    121 + Days    ,    2000

B    ,    Seriously Past Due    ,    11000];

Types:

LOAD fieldvalue('Product',iterno()) as Product

AUTOGENERATE 1

WHILE len(fieldvalue('Product',iterno()));

Totals:

LOAD

'Total' as TypeGroup,

Product

RESIDENT Types;

CONCATENATE (Totals)

LOAD

Product as TypeGroup,

Product

RESIDENT Types;

DROP TABLE Types;

Take TypeGroup and LeadTime as dimension, SUM(Value) as expression

Check the sample attached file also.

Hope this help.

Regards,

Sokkorn Cheav

pgalvezt
Specialist
Specialist
Author

Thanks for your reply, this its really works, but Im trying with div and didn't work. How can I do this?

pgalvezt
Specialist
Specialist
Author

Any Idea?

Thanks!

pgalvezt
Specialist
Specialist
Author

Div require 2 values. In this case how can I do it?

pgalvezt
Specialist
Specialist
Author

Anyone?

Not applicable

Hi,

I'm not use to understand. You probably have to use a set analysis.

Could you give an example?

pgalvezt
Specialist
Specialist
Author

The answer is on the top. But now I need to do the same thing but with DIV numeric fuction.

Thanks!

pgalvezt
Specialist
Specialist
Author

I hope you understand the question.

Thanks!