# New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:
Specialist

## Aggr without Dimension

Hi Community,

I have scenario like below, but the challenge is in my chart there is no dimension but I need to compare with each record of NS.

if we have dimension then we can use if(sum(Sale_X) - sum(Sale_Y)>0, sum(Sale_X) - sum(Sale_Y)), but without dimension I am not getting 10+30(possitve diff value). Can some have any suggestion on this scenario. Need in front end only.

 NS Sale_X Sale_Y Difference Amount Expected only sum of Possitive difference ammount A 10 20 -10 B 40 30 10 10 C 80 50 30 30 D 100 120 -20

- Priya

1 Solution

Accepted Solutions
MVP

Or even this might work:

Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} NS)

Update: My bad, I meant this:

=Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} Sale_X) - Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} Sale_Y)

Sample attached

3 Replies
MVP

Is this in a text box object? May be try this:

Sum(Aggr(If(Sum(Sale_X) - Sum(Sale_Y)>0, Sum(Sale_X) - Sum(Sale_Y)), NS))

MVP

Or even this might work:

Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} NS)

Update: My bad, I meant this:

=Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} Sale_X) - Sum({<NS = {"=Sum(Sale_X) - Sum(Sale_Y) > 0"}>} Sale_Y)

Sample attached

Specialist

this is correct but creating performance issue