Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to capture previous value of my closing account as opening account for the next month . scenario
| Year | Month | Opening balance | Closing Balance |
|---|---|---|---|
| 2011 | Jan | 0 | 237 |
| 2011 | Sep | 237 | 445 |
| 2012 | Feb | 445 | 679 |
| 2012 | Nov | 679 | |
| x | |||
| Day n | x |
Also date; i have about 16 months in which all other 4 months are merged into december. Find attached QVW ffile
You can take advantage of the Above() function like this:
bal2.qvw: failed to open
to set opening balance
source:
LOAD Year,
Month,
date(Date#(Year & '-' & Month & '-01', 'YYYY-MMM-DD')) as Date,
[Closing Balance]
FROM
[http://community.qlik.com/thread/157634]
(html, codepage is 1252, embedded labels, table is @1)
where len(trim(Month))>0;
final:
load
*,
alt(peek([Closing Balance]),0) as [Opening balance]
Resident source
order by Date;
DROP Table source;

The value for closing balannce for the last month Dec 2013 isnt moved to the next year january. this is the major issue i have
Hello Massimo,
This cool, but not really what i want. Find attached I have drill down in it and i just want the value of Dec closing bal. to be passed to Jan opening bal. on drill down
If you make sure to have a dimension which is a combination of year and month you will be able to span past years...
We cannot open Your QVW file (bal2).
In set analyses You will not do it. You should in LOAD SCRIPT make right calculations and insert previous values in base date row.
Actually the application with test data that I uploaded proves that there is no problem getting closing balance from the previous year. Have a look at that application. If you use a Pivot Table instead of a Straight Table you might have a problem with the Above() function IF your dimension grouping is not correct...
Give me a clearer scenario