# How to combine data

**URL:** <https://discourse.ladybug.tools/t/how-to-combine-data/20934>\
**Category:** ladybug-legacy\
**Created:** [February 17, 2023, 5:55pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934 "2023-02-17T17:55:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![yinlong](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/y/ecc23a/32.png) [@yinlong](https://discourse.ladybug.tools/u/yinlong)\
**Post date:** [February 17, 2023, 5:55pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/1 "2023-02-17T17:55:05Z")

</div>

as i need to simulate the energy use for the district, and i have seprated to few .gh files for simulation. Each file can simulate the result successfully. However, i would like to combine the whole district for analysis, i.e. how to call back all .sql files related to this district into one .gh file. Therefore, what is the fastest method to call back the .sql file so that the results can be analyzed by ladybug?

---

<div class="post-metadata">

**Author:** ![BenGottkehaskamp](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/bengottkehaskamp/32/20257_2.png) [@BenGottkehaskamp](https://discourse.ladybug.tools/u/BenGottkehaskamp)\
**Post date:** [February 21, 2023, 4:42pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/2 "2023-02-21T16:42:44Z")

</div>

if you already run the simulations, you can just call the .sql file with a panel or a filepath and reimport it via the read result components under the tab 6::results.  
You can find these under "C:Ladybug’NameofyoufSimuletion’…

Than you can deconstruct the data and add it up hourly, etc. - whatevery you like and recombine it with a suitable header, thus it can be used for graphs again.

---

<div class="post-metadata">

**Author:** ![yinlong](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/y/ecc23a/32.png) [@yinlong](https://discourse.ladybug.tools/u/yinlong)\
**Post date:** [February 21, 2023, 5:07pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/3 "2023-02-21T17:07:01Z")

</div>

however, there are about 100 .sql files. I need to type their path manually? Or there is a fast method to recall these 100 .sql files?

---

<div class="post-metadata">

**Author:** ![BenGottkehaskamp](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/bengottkehaskamp/32/20257_2.png) [@BenGottkehaskamp](https://discourse.ladybug.tools/u/BenGottkehaskamp)\
**Post date:** [February 21, 2023, 6:36pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/4 "2023-02-21T18:36:43Z")

</div>

No you can autoomatically create the filepath either using python or simple grasshopper components. For example I have an automatic naming convention for the files and then I just add via “concentrate” the other parts to create the full filepath. Here is a snipped:

 ![image](https://discourse.ladybug.tools/uploads/default/original/3X/4/2/42a463c7a1b71967b0a0fb20cace46b91bdcf3bc.png)

This is then used as an Input to the read results.

---

<div class="post-metadata">

**Author:** ![yinlong](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/y/ecc23a/32.png) [@yinlong](https://discourse.ladybug.tools/u/yinlong)\
**Post date:** [February 21, 2023, 7:08pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/5 "2023-02-21T19:08:32Z")

</div>

> [@BenGottkehaskamp](#):
>
> sing python or simple grasshopper components. For example I have an automatic naming convention for the files and then I just add via “concentrate

would you mind to show me the name of the grasshopper components which you have used in the above snap?

---

<div class="post-metadata">

**Author:** ![minggangyin](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/minggangyin/32/216_2.png) [@minggangyin](https://discourse.ladybug.tools/u/minggangyin)\
**Post date:** [February 22, 2023, 2:33am UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/6 "2023-02-22T02:33:11Z")

</div>

> [@yinlong](#):
>
> would you mind to show me the name of the grasshopper components which you have used in the above snap?

It is concentrate componet.  
 ![image](https://discourse.ladybug.tools/uploads/default/original/3X/d/8/d826a5698225fd8a49b7dcbbbab7b118d04b30ab.png)

---

<div class="post-metadata">

**Author:** ![yinlong](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/y/ecc23a/32.png) [@yinlong](https://discourse.ladybug.tools/u/yinlong)\
**Post date:** [February 22, 2023, 6:07am UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/7 "2023-02-22T06:07:04Z")

</div>

Would you also mind to upload the .gh file for me, as i dont know how to write a program

---

<div class="post-metadata">

**Author:** ![anthony](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://discourse.ladybug.tools/u/anthony)\
**Post date:** [March 3, 2023, 6:43pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/8 "2023-03-03T18:43:26Z")

</div>

[ReadResultsFromSQL.gh](https://discourse.ladybug.tools/uploads/short-url/aByLDXJT1sA1qgKbrUhg4hn8Ldq.gh) (46.1 KB)

Attached is my solution to this.

Recently I needed to re-read results from a Dragonfly/UrbanOpt simulation of a couple thousand buildings. I had to split those buildings into groups - roughly 100-200 buildings at a time - to reduce the size - and it still took 15-20 mins to read the results (when loading hourly results; daily or monthly results reporting would be much faster).

The file uses the export excel tool from TTToolbox and a custom C# component to split the resulting text into multi-line text (so you can copy & paste into column ‘A’ of Excel with building/zone names). I downloaded the C# component a while ago - it’s from another user on the LBT forum, but I couldn’t find the post to give them credit for it.

Hope this is helpful to you,  
-Anthony

---

<div class="post-metadata">

**Author:** ![anthony](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://discourse.ladybug.tools/u/anthony)\
**Post date:** [May 30, 2025, 3:13pm UTC](https://discourse.ladybug.tools/t/how-to-combine-data/20934/9 "2025-05-30T15:13:27Z")

</div>

I’m correcting the above post, as the script does not account for multipliers. It appears that multipliers are NOT required on ‘heating’, ‘cooling’, and ‘hot\_water’, as the sum of the time-series value are equal to the totals in the EnergyPlus Report tables.

However, ‘lighting’ and ‘electric\_equip’ (and possibly other energy services which are not in my simulations) do need to be multiplied by the Zone Multiplier in order to match the annual total in the EnergyPlus Report tables.

See attached script, which also provides a lookup and export of annual totals from the EPlus reports to facilitate double-checking.

Requires the plug-in TT Toolbox to export Excel results.

_4 June 2025 edit:_  
Revised Gh script  
[20250604\_ReadResults\_withMultipliers.gh](https://discourse.ladybug.tools/uploads/short-url/4a498sKd4r5bWpGt5vwKfIYCtbo.gh) (83.4 KB)
