Let's say I want to build a comparison app that can take any two SQL statements, run them against two different databases with the same structure, but possibly different data and compare them.
I would like to take the data stream at that point and do a kind of Dynamic Summarize
- Any number field, I want to do a sum on
- Any date field I want to do a min and max on
- Get an overall row count
So coming out of the dynamic summarize will be a one row Datastream that would look something like
row_count | sum_numfield1 | sum_numfield2 | min_datefield1 | max_datefield1 | min_datefield2 | max_datefield2
Then I want to print those two rows out, so that I can do a easy visual verification on them. Ideally, it would be great to do some kind of dynamic comparison to see if any of the values are different and mark it as "match" or "not match"
But the issue here, is I don't know what fields will be there, because the SQLs will be arbitrary. I know they will both run and both pull back data, but I need to dynamically build the summarize and I don't see a dynamic summarize tool. Hoping someone else has a solution for me
I thought about multifield formula, but it doesn't let you do aggregation, so it's not what I'm looking for.
I thought about cludging together something using field info and macros but I'm not sure that's the right track either.
Any ideas?