Forum Discussion

MichaelHearst13's avatar
MichaelHearst13
Regular Visitor
8 years ago

Calculate difference between summarized data column and static table

Hi all,

 

I have actual sales data synched and summarized (date hierarchy -- month) from my SQL server (let's call this Ledger), and a static table that I created with monthly sales targets (let's call this Sales Projections). I want to calculate Ledger - Sales Projections.

 

I've tried to calculate the the results of numers solutions for taking the difference between columns without any luck.

 

Does anyone have any ideas on how I may calculate the difference?

 

Thanks in advance!

 

 

5 Replies

  • Can you share how those tables are connected and what the columns in those tableS?

    • MichaelHearst13's avatar
      MichaelHearst13
      Regular Visitor

      Sure --

      Below is a rough example:

      Ledger has hundreds of thousands of lines, connected (green) to a calendar table by each date

      Calendar table connects (pink) to a summary Sales Projection table.

       

       

       

       

    • MichaelHearst13's avatar
      MichaelHearst13
      Regular Visitor
      table 1)Ledger table 2)Calendar/Date Table table 3)Sales Projection 
                
       trans_dateSales DateMonthNameLong MonthSls/DaySales (forecasted)
       1/1/2017500 1/1/2017January January68215000
       .. .. February65013000
       .... .... March….
       2/1/2017480 2/1/2017February    
      • parry2k's avatar
        parry2k
        Super User

        Based on what i see, you need to have date in sales projection instead of month and link that date with calendare date table, also ledger will have relation on trans date to date column in calendar table and it should be straight forward from there. let me know if you already tried this.