Skip to main content
You can succeed best and quickest by helping others to succeed. Join the conversation.
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Selecting Previous yr Week range corresponding to curr yr week range.

Plzzz tell me how to select the previous yr week  range corresponding to the curyr week range ??

Curr yr week range is :

(((sum({<Transaction_Type={'Sell In'},LinkCommonDate={">=$(vYearStartDate) <=$(vMaxMnthEndDate)"},Week={">=$(vWeekRangeStart) <=$(vWeekRangeEnd)"} >}[Sales Gross Amt]-[Sales Return Amt]))

1 Reply

Hard to say with so little information. Maybe it's as simple as adding an addyears function:

sum({<Transaction_Type={'Sell In'},LinkCommonDate={">=$(=addyears($(vYearStartDate),-1)) <=$(=addyears($(vMaxMnthEndDate),-1))"},Week={">=$(vWeekRangeStart) <=$(vWeekRangeEnd)"} >}[Sales Gross Amt]-[Sales Return Amt])

If that didn't work you will have to post an example document with enough data to calculate the correct results. See Preparing examples for Upload - Reduction and Data Scrambling

talk is cheap, supply exceeds demand