Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am wondering if someone can point me to the right direction here.
Suppose I have Table1 below
Table1:
Col1 Col2
a 1
b 2
c 3
d 4
I would like to have a load script t that load Table1 and create Table2 (which add a total column)
Table2:
Col1 Col2 Total
a 1 10
b 2 10
c 3 10
d 4 10
For reason that I won't get into it, I need to use a load script. Can someone help me out, I am just not sure how to accomplish this in QV. Thank you.
Table1:
load Col1, Col2
from ...somewhere...;
join(Table1)
load sum(Col2)
resident Table1;
Try the following script:
Table2:
NoConcatenate
Load *, 10 as Total Resident Table1;
Unfortunately, I need the total column to be dynamic. For example, Table1 can have 100 or 1000 or 10000 rows, and I need to be able to calculate that dynamically.
Sent from Samsung Mobile
Table1:
load Col1, Col2
from ...somewhere...;
join(Table1)
load sum(Col2)
resident Table1;
Works great, thank you Gysbert.
A quick question (hope you don't mind), what if I need an accummulative sum column, how would I accomplish that? Thank you..
Table1:
load Col1, Col2, rangesum(peek('Cumulative',Col2) as Cumulative
from ...somewhere...;
Thank you.