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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
yelin_nyu
Creator
Creator

incorrect aggregation at grand level

Hi I am a Qlikview newbie. I want to draw a line graph using the table in test123 file: I want to add the positive inventory together, so change all negative values to 0 in adjusted inventory field.

If I add Account to the dimension in Graph table, then Adjusted Inventory Value would be correct, but if I take it out, then the calculation changes to inventory. I want to see sum of adjusted inventory by date.

Order_date    Adjusted Inventory Value

    total                   $196

1/1/12                    $76

1/10/12                  $120

How do i fix it? Thanks!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

=sum(if(Inventory*Price<0, 0, Inventory))*avg(Price)

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

=sum(if(Inventory*Price<0, 0, Inventory))*avg(Price)

Hope this helps,

Stefan

sivarajs
Specialist II
Specialist II

PFA

Guess that's your expected result

--Siva