Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
One fundamental rule of databases is that once you copy a database you start the process of your data becoming corrupted because subsequent changes to the data or structure to either database will become difficult or impossible to reconcile.
However, there are times when data in two different tables needs to be reported in one report. Typically in databases that use SQL this is done with a UNION query. This isn't possible with QuickBase but you can emulate the net result.
Let's say you have two tables dbid1 and dbid2. Create a third table dbid3 which will be used solely to temporarily view the merged data.
Using script and the API perform these stems:
1) Purge dbid3
2) Query dbid1 and obtain csv1 using:
5) redirect to the appropriate report of dbid3 which will show the merged data
The resulting report will only be valid at the time you invoke the script but you can view the merged data, manipulate it or link back to the source data in either of the original tables using native formulas and features. The reason we purge dbid3 table at the start of the process is to generate fresh results each time you invoke the script.
However, there are times when data in two different tables needs to be reported in one report. Typically in databases that use SQL this is done with a UNION query. This isn't possible with QuickBase but you can emulate the net result.
Let's say you have two tables dbid1 and dbid2. Create a third table dbid3 which will be used solely to temporarily view the merged data.
Using script and the API perform these stems:
1) Purge dbid3
2) Query dbid1 and obtain csv1 using:
dbid1?a=q&qid=6&opts=csv3) Query dbid2 and obtain csv2 using:
dbid2?a=q&qid=6&opts=csv4) Import csv1 and csv2 into the third table dbid3 making sure the columns are similar
5) redirect to the appropriate report of dbid3 which will show the merged data
The resulting report will only be valid at the time you invoke the script but you can view the merged data, manipulate it or link back to the source data in either of the original tables using native formulas and features. The reason we purge dbid3 table at the start of the process is to generate fresh results each time you invoke the script.