Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Partner - Champion III
Partner - Champion III

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