简体   繁体   中英

SSRS graph expression - custom week filter/expression

I've got a graph in SSRS, and as you can see in the picture below, there's no data before week 47. To make my graph more visually appealing, I would like to put a filter on it to ensure that its starting point is week 47. I've attempted to put a filter on my graph (picture attached below). The problem is that if I set my week filter to >=47 then my graph won't show any data from 2019 , as the starting point for 2019 is week 1 which is obviously less than 47. Does anybody know what filter/expression I should use in order to make sure that starting point is week 47 without cutting off any data from 2019?

在此处输入图片说明

Try to stick the fields Year and Week to be in "YYYYWW" format (by adding a calculated field in Dataset directly in Reporting Services, for example) and filter the graph by [Year_Week] >= 201847.

The calculated field [Year_Week] will be an integer and calculated like in example below (assuming that you have separated integer fields [Year] and [Week], so if this is not the case then the formula may differ from mine):

=CInt(CStr(Fields!Year.Value) & Right("00" & CStr(Fields!Week.Value), 2))

This image shows how my calendar table looks like with the new calculated field Year_Week which now can be used for filtering

也许这可以做到:

[Week]>=47 OR [YEAR]>=2019

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM