Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmhmh91
Contributor
Contributor

Group data based on calculation results

Hi All,

I have table like below.

Current ValueTarget Value(Current - Target) Delta
1005050
1206060
7780-3
622240
70100-30
5051-1

I want to show a total of (Current - Target) Delta <0 and (Current - Target) Delta >= 0 in KPI objects. How to do that?

Thank you,

Mandi

1 Solution

Accepted Solutions
sunny_talwar

May be this

>= 0

Sum(RangeMax(([Current Value] - [Target Value]), 0))

and

< 0

Sum(RangeMin(([Current Value] - [Target Value]), 0))

View solution in original post

5 Replies
aarkay29
Specialist
Specialist

Based on what you provided

may be this

Sum(Aggr(only({<[Current Value]={"=[Current Value]>[Target Value]}>}[Current Value]-[Target Value]),[Current Value],[Target Value]))      for '>0'

Sum(Aggr(only({<[Current Value]={"=[Current Value]<[Target Value]"}>}[Current Value]-[Target Value]),[Current Value],F2))      for '<0'


But there should be a proper ID to aggregate instead using values

If you have a key then use this

Sum(Aggr(only({<ID={"=[Current Value]>[Target Value]"}>}[Current Value]-[Target Value]),ID))

sunny_talwar

May be this

>= 0

Sum(RangeMax(([Current Value] - [Target Value]), 0))

and

< 0

Sum(RangeMin(([Current Value] - [Target Value]), 0))

sunny_talwar

Sample attached

Capture.PNG

mhmhmh91
Contributor
Contributor
Author

It seems the result is not correct. Thank you all the same!

mhmhmh91
Contributor
Contributor
Author

It solves my problem. Thank you very much!