Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I would like to know if there is any function that let sum the absolute values while the script is loading. Something like this:
MapValuedQuantity:
MAPPING LOAD
[Document No_], [Valued Quantity];
SQL SELECT [Document No_], Sum(ABSOLUTE([Valued Quantity])) AS [Valued Quantity]
FROM "$(_DBName)"."$(_DBOwner)"."$(_CompanyName)$Value Entry"
GROUP BY [Document No_];
I've tried the fabs() but it doesn't work here.
Good weekend to you all.
Hi,
Try this script
Temp:
[Document No_], [Valued Quantity],
1 AS Temp;
SQL SELECT [Document No_], [Valued Quantity] AS [Valued Quantity]
FROM "$(_DBName)"."$(_DBOwner)"."$(_CompanyName)$Value Entry";
MAPPING LOAD
LOAD
[Document No_],
Sum(fabs([Valued Quantity])) AS
[Valued Quantity]
RESIDENT Temp
GROUP BY
[Document No_]
;
DROP TABLE Temp;
Regards,
jagan.
Hi You can use workaround as
Sum(If(Quantity<0,Quanitity*-1,Quantity)) as AbsQuantity
Hi,
In qlikView use Sum(Fabs([ValueQuantity]))
Celambarasan
Hi,
Try like this
TableName:
LOAD
F1,
Fabs(F2) AS F2;
LOAD * INLINE [
F1, F2
a, -1
b, 2
c , -3
];
Regards,
Jagan.
Hi,
Try this script
Temp:
[Document No_], [Valued Quantity],
1 AS Temp;
SQL SELECT [Document No_], [Valued Quantity] AS [Valued Quantity]
FROM "$(_DBName)"."$(_DBOwner)"."$(_CompanyName)$Value Entry";
MAPPING LOAD
LOAD
[Document No_],
Sum(fabs([Valued Quantity])) AS
[Valued Quantity]
RESIDENT Temp
GROUP BY
[Document No_]
;
DROP TABLE Temp;
Regards,
jagan.
Hi thanks you three for your time. I've tried the three methods and the jagan's one was the only that worked.
Nice day.