Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please help on below question:
Test:
LOAD * INLINE [F1, F2, SALES
A, X, 4
A, Y, 2
A, X, 2
B, Y, 3];
OutPut Required:
F1, Sales
A,6
B,3
Please exclude A, Y, 2 in Test Table.
Regards
Ravi
Hi Ravi
Simply use Dimension
F1
and in expression use sum(Sales)
Hi kushal,
Please check what out put required.
Regards
Ravi Gupta
Maybe like this:
Output:
LOAD F1,
sum(SALES) as Sales
RESIDENT Test
where F2 <> 'Y' or F1 <> 'A' group by F1;
Write a load script like
Test:
LOAD *,F1&F2 as Key;
LOAD * INLINE
[
F1, F2, SALES
A, X, 4
A, Y, 2
A, X, 2
B, Y, 3
];
NoConcatenate
Data:
LOAD F1,F2,SALES
Resident Test Where not Match(Key,'AY');
DROP Table Test;
And take straight table
Dimension:- F1
Expression:- Sum(SALES)
Hi Ravi,
Please see the attachment.
Thanks,
AS
in a chart
dim F1
exp sum(if(F1&F2<>'AY', SALES))
in a script
Test:
LOAD * INLINE [F1, F2, SALES
A, X, 4
A, Y, 2
A, X, 2
B, Y, 3];
Result:
NoConcatenate
load
F1,
sum(SALES) as SALES
resident Test
where F1 & F2 <>'AY'
group by F1;
drop table Test;
Hi Ravi,
Please follow this one.
Thanks,
AS
Script
=============
Test:
LOAD
*,
IF(F1&F2='AY',1,0) as Flag
INLINE
[
F1, F2, SALES
A, X, 4
A, Y, 2
A, X, 2
B, Y, 3
];
========================
Create a straight table
Dimension
F1
Expression
SUM({<Flag = {0}>}SALES)
Hi Ravi
Try this in script
Test:
LOAD * INLINE [F1, F2, SALES
A, X, 4
A, Y, 2
A, X, 2
B, Y, 3];
b:
load F1&F2 as Key,
F1 as F11,
F2 as F22,
SALES as SALES1
Resident Test where F1&F2<>'AY';
and then use F11 as Dimension and
sum(SALES1) as expression
in straight table
You will get ur result