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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation based on condition

ProductsubSales          a            b
bavcoffe1014
bavcoffe1224
bavcoffe1534
bavcoffe1344
bavcoffe1254
bavcoffe1264
bavcoffe174

1. Don't want to use aggr().

2. when a<=b-- calculate-- Sum(Sales).

output should be ---

--bav  Coffe  50 (10+12+15+13)

2 Replies
sunny_talwar

What are your chart dimensions?

May be create a uniquely identifiable key in the script like this:

LOAD Product,

          sub.

          Sales,

          a,

          b,

          AutoNumber(Product&'|'&sub&'|'&a&'|'&b) as Key

FROM Source


And then may be like this:


Sum({<Key = {"=a <= b"}>} Sales)

sunny_talwar

Note: This uniquely identifiable key will only work, if you have a truely unique key, else you might not see the right results.

Capture.PNG