Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fabs function dimension set analysis

Hello guys,

I need to create an expression based on a field like: SUM({<fabs(FIELD) = {'20'}>} VALUE). Thats is, I need to sum VALUE where the absolute value of FIELD is equal to 20 (so, the FIELD = 20 and FIELD = -20 will be considered in the SUM). However I couldn't find a way to do without creating a second field in the script using the FABS function (I want to avoid creating it).

Thanks!!

1 Solution

Accepted Solutions
sunny_talwar

How about this?

Sum({<FIELD = {'20', '-20'}>} VALUE)

or

Sum({<FIELD = {"=fabs(FIELD) = 20"}>} VALUE)

View solution in original post

5 Replies
sunny_talwar

How about this?

Sum({<FIELD = {'20', '-20'}>} VALUE)

or

Sum({<FIELD = {"=fabs(FIELD) = 20"}>} VALUE)

Kushal_Chawda

Better to create the Flag in script

LOAD if(fabs(FIELD)=20,1) as Flag

....

FROM Table.qvd(qvd)

Now create the Expression

sum({<Flag={'1'}>} Value)

Replace QVD name with your actual QVD with Path

sunny_talwar

I think OP wants to avoid making changes to the script

Anonymous
Not applicable
Author

Hi

try this

SUM({$<FIELD={'*20'}>} VALUE)

Kushal_Chawda

then you are correct