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

Aggr function

i have the following data.

Entry NoItem No.SalesCost
1a10020
1b10010
1c10020
1d10030

Since entry No. is constant, i want Total sales of 100, but the cost should be 80.

What function can i use.

I tried aggr function. but it is not working.

7 Replies
sagarkharpude
Creator III
Creator III

Try nodistinct

PrashantSangle

Hi,

Create Straight table

take

Dimension => Entry No.

Expression

1: Aggr(Concat([Item No.],','),[Entry No])

2: Sum(Distinct Cost)

3: sum(Cost)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
giakoum
Partner - Master II
Partner - Master II

In a chart with Entry No as dimension :

Expression for sales : min(Sales)

Expression for Cost : Sum(Cost)

But what is your requirement exactly?

sunny_talwar

For cost you can use this may be:

=Sum(Total <[Entry No]> Cost)

Best,

Sunny

MK_QSL
MVP
MVP

=SUM(Aggr(SUM(DISTINCT Sales),[Entry No]))

and

=SUM(Aggr(SUM(Cost),[Entry No]))

avinashelite

Try like this:

Aggr(sum(Cost),[Entry No])

hic
Former Employee
Former Employee

For the Cost, you should use

   Sum(Cost)

But for the sales, I must ask: What is the logic?

If one Entry Number has several sales values - which should you pick? The average?

Further, should the sales number be summed for different Entry Numbers? If so, you should use

  Sum(Aggr(Avg(sales), [Entry No]))

HIC