Lookup and previous value

The first of these two functions gives you the ability to reference values in other rows, while the second gives you the ability to carry forward values. Notice from the following screenshot that direction is very important for these two functions:

Both calculations are computed using an addressing of Category (so Department is the partition).

Here, we've used the code Lookup(ATTR([Category]), -1), which looks up the value of the category in the row offset by -1 from the current one. The first row in each partition gets a NULL result from the lookup (because there isn't a row before it).

For Previous_Value, we used this code:

Previous_Value("") + "," + ATTR([Category]) 

Notice that in the first row of each partition, there is no previous value, so Previous_Value() simply returned what we specified as the default: an empty string. This was then concatenated together with a comma and the category in that row, giving us the value, Bookcases.

In the second row, Bookcases is the previous value, which gets concatenated with a comma and the category in that row, giving us the value, Bookcases, Chairs & Chairmats, which becomes the previous value in the next row. The pattern continues throughout the partition and then restarts in the partition defined by the department Office Supplies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.202.209