Let's say a field, named DAY, is part for several tables. Thus it will be used as key between those tables.
I'm looking for a nice way to get, in the script part, for instance the Min value of DAY, across all tables which contain that field (and known at this step of the build).
In the visualization side, Day fields are gathered, wherever they come from, but in the script part, it seems every aggregation function has to be related to a table.
Of course, I may look for the min(DAY) of each table and then for the "Min of the Mins", but I would have like to be able to use someting like "Let vMinDate = Min(DAY);" (which by the way doesn't stop the build process but leads to a NULL value). I guess it's because gathering of homonymous fields are only made at the end of the build, but... in case a solution does exist, I'd like to use it
//Put this at the end of your script
SET vSourceField = [DAY];
Min(FieldValue('$(vSourceField)', RecNo())) as [MinDay],
Max(FieldValue('$(vSourceField)', RecNo())) as [MaxDay]
This will create a table named DayMinMax with 2 fields ([MinDay], [MaxDay])
Keep in mind, if [DAY] is a DATE field field, you will want to wrap each expression in a Date() function or you will have the integer representation of that date.