Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lakhansajwan
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
Gysbert_Wassenaar

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