Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Id like to calculate ( columnA * columnB).
These are the same table.
How can I calculate with script?
CAn you give an example of your data?
Here's one way, with a small amount of inline data:
multiples:
load * Inline
[columna, columnb
4,5
2,6
3,7
9,12
];
multiplier:
Load
columna,
columnb,
(columna*columnb) as columnc
Resident
multiples;
drop table multiples;
Thank you
When I have a data like the pic., I wanna calculate below.(keys are ID and data.)
I would like to get the ResultC.
cal1)sum(data 2) as ResultA
cal2)data2/ResultA as. ResultB
cal3)Result(data1*ResultB) as ResultC
Do you have any idea of script?
I wrote the script, but I can't get the value I expected.
key: ID&Date as Key
[Script]
Temp:
Load
key,
Sum(data2) as ResultA
Resident [File_Name]
Group By key;
Left Join(Temp)
Load
key,
data2/ResultA as ResultB
Resident Temp0
Group By key;
Left Join(Temp)
Load
key,
Sum(data1*ResultB) as ResultC
Resident Temp0
Group By key;
Thank you
When I have a data like the pic., I wanna calculate below.(keys are ID and data.)
I would like to get the ResultC.
cal1)sum(data 2) as ResultA
cal2)data2/ResultA as. ResultB
cal3)Result(data1*ResultB) as ResultC
Do you have any idea of script?
I wrote the script, but I can't get the value I expected.
key: ID&Date as Key
[Script]
Temp:
Load
key,
Sum(data2) as ResultA
Resident [File_Name]
Group By key;
Left Join(Temp)
Load
key,
data2/ResultA as ResultB
Resident Temp0
Group By key;
Left Join(Temp)
Load
key,
Sum(data1*ResultB) as ResultC
Resident Temp0
Group By key;