Forum Discussion
Hi Jack,
Thanks for your feedback. I just wanted to clarify a few things that I think were misinterpreted:
- I'm only creating the datacell objects from scratch as an example to demonstrate the fundamental issue (status is incorrect) for this forum post. As I mentioned at the top of the post, the actual code is in a typical Data Buffer Cell Loop structure. So, it's pulling a data buffer, looping thru the records in that data buffer, modifying the contents of those records, and writing out the result data buffer. Both the data buffer definition and modifications are driven by end-user input. But the fundamental issue is the same - within the contents of the result data buffer, the cell status doesn't reflect the cell's updated metadata.
- I can't do a GetDataCell, because this is inside of a calculation. The data record doesn't exist in the database until the calculation writes out the result data buffer to the database. So, it's a catch-22: I can't pull a GetDataCell until the cell is written to the database, but I can't write to the database until I do the correct calculation.
Sorry if the example caused confusion, but I wanted to focus on the core issue - how/why cell status works(or doesn't work) the way it does - not on the structure of the rule.
Thanks,
- JackLacava2 years agoHonored Contributor
There is never going to be a cell in a buffer that targets a parent for Account-like dimensions, because there is never a record created for parents in those dimensions. So all those PKs will always reflect base elements for those dimensions. When you use those to build synthetic elements in memory, the system doesn't go back to the database to check if the new Pk is valid or anything, it's just an abstract representation that you built (effectively, a dictionary of some sort); anything you don't explicitly set, won't be refreshed for you. So those flags will always stay at False.
If you want to retrieve representations of actual data and datastructures, you have to do a "Get" call of some sort. With those, if you explicitly target parents in Account-like dimensions, the system will calculate values in memory and should give you a synthetic representation that has the correct flags.
For the record, if you are doing this because you're trying to "roll your own rollups", use the Convert* functions instead, they will do the work for you.
Related Content
- 2 years ago
- 3 years ago
- 11 months ago
- 9 months ago
- 7 months ago