Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a problem of calculating with script.
When I have a data like the pic., I wanna calculate below.(keys are ID and data.)
Does anyone know how to make the script?
I would like to get the ResultC.
cal1)sum(data 2) as ResultA
cal2)data2/ResultA as. ResultB
cal3)data1*ResultB as ResultC
cal4) Sum(ResultC)
Thank you.
SUM(data1*ResultB) AS ResultD
You can't Reference ResultC as does not exist until the table is loaded.
thank you,
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 ResultD
Resident Temp0
Group By key;
I would like to get the value of ResultD.(depends on 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;