Has anyone had any success creating a grid in Kinetic based on a dynamic set of data returned from a PIVOT query?
My query looks at a range of parts and brings back the valid ListCode values from PriceLst. It then pivots on the returned ListCodes and sets the value of the part row equal to the BasePrice in PriceLstParts based on Partnum and ListCode. So my data might look like:
If there was a set number of columns, I think this would be simple, but because the number of columns can change with each query, I can’t figure out how to set up the grid for it.
I haven’t done this (haven’t had a need to experiment with Pivot BAQs… yet).
… sorry, can’t NOT include that gif in a Pivot based post.
Since you have a BAQ set up to play with… I’m wondering if you would need to combine this setting:
Grid Model (at the bottom):
This autoloads the columns from the DataView.
And then you would need to add a dataview-clear action into your event when your BAQ fires.
What I’m not sure of is whether that action simply clears the VALUES out of the target dataview, or if it wipes it clean and when your BAQ runs it may repopulate the dataview with a new column set as well??
There’s also this one on Grid Model > Provider Model
But, I can’t really get a good grasp based on the hover-text.
Have you created your BAQ dataview yet? Did it pull ALL columns into the dataview when you did?
Anyway… again, haven’t done it, but curious if these settings may be worth experimenting with.
For Kinetic, I’m building a function to do the pivot. I will then get the grid data from the function already pivoted.
I haven’t actually tried to set up the grid, but from the experience I have with them, you define the columns when you bind the grid to the dataview. If my dataview is changing each time the form is loaded, I’m not sure how the binding would work.