Well, my fault..
I want to add the targets by month and years per salesperson like
Salesperson Date MonthStart(Date) as Target_Month ?? in Amount YearStart(Date) as Target_Year ?? in amount Header 5 AA 01.01.2015 100 1200 AA 02.02.2015 100 1200 AA 03.03.2015 100 1200 BB 01.01.2015 200 2400 BB 02.02.20015 200 2400
at the end, I want to get this
Salesperson Date Month Year sum(amount) sum(target_amount)? AA 01.01.2015 January 2015 130 100 AA 02.02.2015 February 2015 50 100 AA 03.03.2015 .. .. 70 100 TOTAL 250 300
Generally Targets are more likely Monthly or Yearly. In your file have both seems to be both are same. If you have different month & year targets you can load two targets separately in same tables.
// First Load the Monthly Targets.
SalePerson & '|' &MonthStart(Date) AS %Key_TargetMonthly,
SalePerson & '|' &YearStart(Date) AS %Key_TargetYearly,
Create the %Key_TargetMonthly & %Key_TargetYearly in you fact table with same functions.
Please note that, year targets on Year level & Month target on Month level.