[GNC] Importing stock splits via csv

Geoff cleanoutmyshed at gmail.com
Thu Oct 27 07:17:06 EDT 2022


Hi Marcus

This example works for me:-


Date,Description,Commodity/Currency,Action,Full Account Name,Amount,Price

27-10-2022,NVIDIA 3 for 1 Stock 
Split,CURRENCY::AUD,Split,Assets:Investments:Broker 
Account:NVDA,-300,102.000000

,,,,Assets:Investments:Broker Account:NVDA,900,34.000000


See attached screenshot and sample CSV file.

Now I am not an accountant, but I believe that you need to supply valid 
prices with a stock split transaction - the "sell" price should be your 
accumulated cost base, and the "buy" price should be your new cost base 
after the split.  If you do not do this you are likely to run into 
problems with capital gains (and imbalances as you experienced).

Hope this helps!

Regards

Geoff
=====

On 26/10/2022 8:40 pm, Marcus Pemer wrote:
> Hello everyone!
> 
> I have recently run into a conundrum that I hope someone would be able to help me with.
> 
> I am importing transactions from a CSV file into a brokerage account. The CSV data containing the split looks like this:
> 
> date,transactionid,description,account,credit,debit,action, price2022-08-25,44689940965,STOCK SPLIT (TSLA),tda_2061:TSLA,203,0,Split, 0.0
> ,44689940965,,Trading:Tradeables:TSLA,0,203,, 0.0
> 
> In other words, I have formatted the data as a multi-line split file for the importer. I am setting the action to Split and attempting to set the commodity price to 0.0 in both split lines.
> 
> I have modeled the above import data based on what I see gets created if I manually create a stock split in GnuCash. Using the Stock Split tool in its simplest version creates a transaction with two splits: the first has action set to "Split" and the second split goes to the trading account. Prices are empty/null when the tool is used.
> 
> I have turned off all Bayesian matching for the importer, if that matters.
> 
> The problem I am facing is that when imported, the above transaction is not recognized as a stock split by the importer. Rather, the commodity price is overridden to 1.0 USD for both splits and my "Trading:Tradeables:TSLA: account gets switched out for "Imbalance-TSLA".
> 
> Would anyone know how I should format the CSV import data so that the stock split gets recognized? Is it even possible/supported? I have so far not been able to find answers in the official documentation.
> 
> 
> Thank you!
> Marcus Pemer
> PGP: CC9E1BAA
> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnc_import_stock_split_csv.jpg
Type: image/jpeg
Size: 547920 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20221027/6c0cb842/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnc_import.csv
Type: application/vnd.ms-excel
Size: 247 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20221027/6c0cb842/attachment-0001.xlb>


More information about the gnucash-user mailing list