Uploading tabular data

Learn how to optimize your data for use with AskAI, allowing it to accurately answer questions based on data in tables.

AskAI struggles to answer questions when the data is in PDF or text formats because it's not structured well. The solution is to use a CSV format which forces a structure, making the data contextually relevant.

Export your data as a CSV file from your table source, like Airtable, Google Sheets, or Excel. This will provide the structured format needed for AskAI to understand and process the information.

To access the CSV upload template, go to your AskAI's dashboard, create a new AskAI project, and click on "?" followed by "Upload a CSV." Then, click on "Use our template" to access the CSV upload template.

Make sure to follow the template instructions, such as not having empty rows, including the content and title columns, not deleting any columns, and adhering to the character and row limits.

Transform your data into key-value pairs for each item in the table. This will help AskAI understand the relationships between the different data points.

Once you have formatted your data according to the template, upload the CSV to AskAI. This will allow the system to effectively process the information and answer questions about the data in the table.

Bonus (Macro)

This is the macro I used to reformat my table, just paste into Excel as a macro module, make sure your sheet with the table in is called Sheet1 and click ‘Run’.

Sub MergeHeaderAndDataForRange()
    Dim ws As Worksheet
    Dim dataRange As Range
    Dim headerRange As Range
    Dim lastCol As Long
    Dim lastRow As Long
    Dim i As Long
    Dim j As Long
    Dim result As String
    
    ' Set reference to the worksheet containing the data
    Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to the name of your worksheet
    
    ' Find the last row and last column of the data
    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
    lastCol = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column
    
    ' Set reference to the header range
    Set headerRange = ws.Range(ws.Cells(1, 1), ws.Cells(1, lastCol))
    
    ' Set reference to the data range (excluding the header row)
    Set dataRange = ws.Range(ws.Cells(2, 1), ws.Cells(lastRow, lastCol))
    
    ' Loop through each row of the data range
    For i = 1 To dataRange.Rows.Count
        result = ""
        ' Loop through each column of the data range
        For j = 1 To dataRange.Columns.Count
            ' Concatenate the header and data with line breaks
            result = result & headerRange.Cells(1, j).Value & ": " & dataRange.Cells(i, j).Value & vbNewLine
        Next j
        ' Write the result to the new column
        ws.Cells(dataRange.Row + i - 1, dataRange.Column + lastCol).Value = result
    Next i
End Sub

Last updated