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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can i use aggr function here?

Hello. I have a simple question:

I have table in my load script that looks like this

Trans.      Product      Price

1              Product 0     xxx

1              Product 1     xxx

2              Product 0     xxx

2              Product 1     xxx

3              Product 1     xxx

4              Product 2     xxx

Lets say "Product 0" is shipping fee. I need to find the sum of eatch transaction that was made in internet and shipped to the client not collected from the store.

Can i achieve this with aggr function somehow? There are plenty of examples of how to use aggr but it's still difficult to understand.

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     I think you don't need aggr function here.

     Create a Chart (Straight table)

     Dimension: Product

     Expression:Sum(Price)

Or

     if you want to do for a specific product expression

     Sum({<Product={'Product 0'}>} Price) in text object

Celambarasan

Not applicable
Author

I need to do expression but when i  use:


Sum({<Product={'Product 0'}>} Price)

i get the sum of  "Product 0" not the whole transaction which also included "Product 1"

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes you will get only product 0 that is what you want or i understood wrongly?If so explain little more.

Celambarasan

Not applicable
Author

Lets say "Product 0" is shipping fee. I need to find the sum of eatch transaction that was made in internet and shipped to the client not collected from the store.