Qlik Community

Ask a Question

New to QlikView

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

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Specialist
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.

   

NSSale_XSale_YDifference AmountExpected only sum of Possitive difference ammount
A1020-10
B40301010
C80503030
D100120-20

- Priya

1 Solution

Accepted Solutions

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

View solution in original post

3 Replies

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))

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

View solution in original post

Specialist
Specialist

this is correct but creating performance issue