reporting services - SSRS - Display latest value in column group -
tables - can't post images yet, posted link examples.
i have 2 tables - 1 sales , 1 inventory. dates in these tables week ending dates - sales totals 1 week , inventory quantity counted @ end of week.
i want create ssrs report, using matrix, showing sales , inventory in column group month row grouping product , product/color.
i wrote simple sql query joins tables product id , date (see 'dataset' in reference image).
the sales information can aggregated normal way - sum. works correctly.
however inventory quantity should not sum'ed - quantities end of period; want show final quantity (the qty latest date) month in column , row group.
the inventory quantities affected not sales, production values also, can't calculate ending inventory.
is there easy way this? perhaps it's better calculate in sql? final report cover year, or more, of data there many column groups.
if you're looking can use expression sum(fields!sales.value) sales value , last(fields!inventory.value inventory value. you'll need sort dataset date pick last value in dataset.
Comments
Post a Comment