Dust Community Icon

Setting Up Calculation Rules in Dust for BigQuery Integration

·
·

Hello, I have connected Dust with my Bigquery table and it's so great ! Now I don't know how/where to give rules about my table. Indeed, Dust can't guess which columns choose to make a rate or calcul field. For exemple I would like ask to dust : "What is my conversion rate ? " but Dust dosen't know which columns choose to make the calcul There is a place where I can give all calculated rules which are related to the questions coming from no-data users ? Thanks in advance

  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    Hi Youcef Zeghiche! I would suggest putting them in the instructions of the agent (i.e. maybe a section like "Business Logic" and then you have the calculations under. If you have a lot, you can also put them in a text file and just give access to the agent via the Search tol

  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    I'd also recommend using the "Analyst" template for the instructions if using BQ

  • Avatar of Youcef Zeghiche
    Youcef Zeghiche
    ·
    ·

    Great, thanks! Abboud Hammour, I have about ten analytical tables (transformed, cleaned, and ready to be queried) with different levels of granularity and different calculation rules. Do you recommend creating a single text file for all tables or one for each table? Should I also follow a specific format?

  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    Single text file should be fine! On format, nothing specific but I'd suggest in text (vs. tabular)) and as clear as possible (i.e. if using a word doc, table names as headings, column names as sub headings, clear descriptions, separate section for business logic)

  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    But otherwise as long as it's clear & you mention in the instructions to use that file to access info on the logic, the agent should be able to use and find it

  • Avatar of Youcef Zeghiche
    Youcef Zeghiche
    ·
    ·

    Oh super thanks ! for exemple this format is good for dust ? do you think dust understand my business logic which is displayed below ?

    sales_transactions
    This table contains successful transactions.
    
    Table Fields:
    
    0.transaction_attempt
    Description: Unique identifier for the attempt of the transaction.
    
    1.transaction_id
    Description: Unique identifier for the transaction.
    
    2.customer_id
    Description: Unique identifier for the customer who made the transaction.
    
    3.product_id
    Description: Unique identifier for the purchased product.
    
    4.transaction_date
    Description: Date and time of the transaction.
    
    5.quantity
    Description: Number of units of the product purchased.
    
    6.total_amount
    Description: Total amount of the transaction in local currency.
    
    payment_method
    7.Description: Payment method used (card, cash, bank transfer, etc.).
    
    8.store_location
    Description: Location of the store where the transaction took place.
    
    Business logic
    1. conversion_rate : transaction_attempt / transaction_id
    
    2. Etc....
  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    Yes I think that would be good (maybe add one line after business logic "this contains business logic for calculations of columns across tables")

  • Avatar of Youcef Zeghiche
    Youcef Zeghiche
    ·
    ·

    Oh thanks ! I have a last question : How Can I help dust to anticipate unpredicted user inputs like "give me transformation rate ?" instead of "conversion rate" ?

  • Avatar of Youcef Zeghiche
    Youcef Zeghiche
    ·
    ·

    I'm sure that i will have many semantic problems

  • Avatar of Abboud Hammour
    Abboud Hammour
    ·
    ·

    No perfect science unfortunately other than putting common terms in the instructions, but LLMs are pretty good at guessing even without so I'd test a few!

  • Avatar of Youcef Zeghiche
    Youcef Zeghiche
    ·
    ·

    Okay thank you very much !