Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
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)

View solution in original post

Kush
MVP
MVP

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

galax_allu
Specialist
Specialist

Hi

try this

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

Kush
MVP
MVP

then you are correct