Use stage variable to calulate ......................
Thanks,
Anupam
check lines amount with total amount
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 232
- Joined: Fri Sep 30, 2005 4:52 am
- Contact:
Thanks all,
but I had to precise that col1 is a column and amount to.
(I have two column)
a sample of my file :
('06' = lines and '08' = total)
------------------------------------------
col1 amount
06 25
06 15
06 05
08 45 (correct amount 25+15+05 = 45)
06 15
08 10 (incorrect total must be 15 )
-------------------------------------------
Thanks ArndW, but I think your solution is just for one column, is it ?
but I had to precise that col1 is a column and amount to.
(I have two column)
a sample of my file :
('06' = lines and '08' = total)
------------------------------------------
col1 amount
06 25
06 15
06 05
08 45 (correct amount 25+15+05 = 45)
06 15
08 10 (incorrect total must be 15 )
-------------------------------------------
Thanks ArndW, but I think your solution is just for one column, is it ?
You changed your metadata since the first post. Instead of my 2 stage variables, just use your two columns, otherwise the solution is the same.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
You can still use this code with small modificaiton.
You havnt mentioned what to do after checking the total with the amount.
You can intoduce a new column callled CorrectFlag. And assign stage variable vCorrectFlag to it.
Code: Select all
vRunningTotal = 0 --> InitialDeclaration.
vCorrectFlag => If Type = '08' Then if Amount = vRunningTotal Then "Correct" Else False Else ''
vRunningTotal =>IF Type='06' THEN RunningTotal+Value ELSE 0
You can intoduce a new column callled CorrectFlag. And assign stage variable vCorrectFlag to it.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'