I am loading the above data from my Purchase Order table the calculating the ave price for each TrnMonth and TrnYear in a table:
Current Period
Sum ({<TrnYear={$(=Max(TrnYear))},TrnMonth={$(=(VPeriod))}>} MatchedValue)/sum({<TrnYear={$(=Max(TrnYear))},TrnMonth={$(=(VPeriod))}>} QtyReceived)
Previous Period
Sum ({<TrnYear={$(=Max(TrnYear))},TrnMonth={$(=(VPeriod)-1)}>} MatchedValue)/sum({<TrnYear={$(=Max(TrnYear))},TrnMonth={$(=(VPeriod)-1)}>} QtyReceived)
and the same for the years by dropping the TrnYear from above. The table shows what prices increased/decreased.
What I want to do is flag the Supplier & Stockcode in my load if there is an increase during the month to enable any easy count of the number of increase/decreases by supplier and stock code. The same for the year averages.