

Creator
2020-05-23
08:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calculate Opening and Closing Balances and store in QVD
Hi
I have the closing balance for last day of week.
I have daily transaction movements for each day of week.
I wish to calculate the Opening and Closing balance for each day in the script and store as a QVD.
Sample data attached
Thanks
Dave
- Tags:
- qlikview_scripting
2,237 Views
2 Solutions
Accepted Solutions
2020-05-23
10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One solution is.
tab1:
LOAD *, [Closing Bal]-Movement As [Opening Bal]
;
LOAD Date, Movement, If(RowID>1, Peek([Closing Bal])-Peek(Movement),[Closing Bal]) As [Closing Bal]
;
LOAD *, RecNo() As RowID INLINE [
Date, Opening Bal, Movement, Closing Bal
1/7/2020, , 70, 1000
1/6/2020, , 60,
1/5/2020, , -50,
1/4/2020, , 40,
1/3/2020, , -30,
1/2/2020, , 20,
1/1/2020, , -10,
];
2,214 Views
2020-05-23
10:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2,213 Views
4 Replies
2020-05-23
10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One solution is.
tab1:
LOAD *, [Closing Bal]-Movement As [Opening Bal]
;
LOAD Date, Movement, If(RowID>1, Peek([Closing Bal])-Peek(Movement),[Closing Bal]) As [Closing Bal]
;
LOAD *, RecNo() As RowID INLINE [
Date, Opening Bal, Movement, Closing Bal
1/7/2020, , 70, 1000
1/6/2020, , 60,
1/5/2020, , -50,
1/4/2020, , 40,
1/3/2020, , -30,
1/2/2020, , 20,
1/1/2020, , -10,
];
2,215 Views
2020-05-23
10:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2,214 Views


Creator
2020-05-24
04:30 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks very much.
works a treat
Dave
2020-05-24
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you welcome
2,183 Views
