Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i have loaded a file as follows
Fund Curency Value
A X 20
B Y 30
C Z 40
D P 50
I wanna added an extra field such that,in curency field i have "P",that value should b populated as a new filed,it should happn dynamicaly i.e.,
output:
Fund Curency Value Value1
A X 20 50
B Y 30 50
C Z 40 50
D P 50 50
My bad, this will work
Sample:
LOAD * Inline [
Fund , Curency , Value
A , X , 20
B , Y , 30
C , Z , 40
D , P , 50
];
Left Join(Sample)
LOAD Max(Value) as Value1 Resident Sample;
Sum(TOTAL Value) will deserve
My bad, this will work
Sample:
LOAD * Inline [
Fund , Curency , Value
A , X , 20
B , Y , 30
C , Z , 40
D , P , 50
];
Left Join(Sample)
LOAD Max(Value) as Value1 Resident Sample;
load * ,if(Curency = 'P',Value) as value1 inline [
Fund, Curency , Value,
A, X , 20,
B , Y , 30,
C , Z , 40,
D , P , 50,
];
it should be
Is this Value1 should hold max value always or it should be driven by Currency?
Extending Anil's script may be try like below:
Currency:
LOAD * INLINE [
Fund, Currency, Value
A, X, 20
B, Y, 30
C, Z, 40
D, P, 50
];
LEFT JOIN(Currency)
LOAD Currency,
Sum(Value) AS Value1
Resident Currency
WHERE Currency = 'P'
Group By Currency;
Then using a straight table add
Dim: Fund, Currency, Value
Expr: = Sum(TOTAL Value1)
You can see below:
Hi,
tmp:
LOAD * Inline
[
Fund,Curency,Value
A,X,20
B,Y,30
C,Z,40
D,P,50
];
MX: LOAD Max(Value) AS MxCurency Resident tmp Group By Curency;
LET vP = Peek('MxCurency');
sumary:
LOAD *, $(vP) AS Value1 Resident tmp;
TRACE $(vP);
DROP Table tmp,MX;