Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nirpanthan
Contributor III
Contributor III

PYTD vs YTD

Hi experts,

kindly help me for PYTD in this scenario 

=(Sum({<Periodname,Segment3={440},ToDate={">=$(vStartDate)<=$(vTillDate)"}>}Closingbalance)+
Sum({<Periodname,Segment3={470},ToDate={">=$(vStartDate)<=$(vTillDate)"}>}Closingbalance)+
Sum({<Periodname,Segment3={480},ToDate={">=$(vStartDate)<=$(vTillDate)"}>}Closingbalance))/vThousand

Labels (1)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this

=(Sum({<Periodname,Segment3={440},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate)"}>}Closingbalance)+
Sum({<Periodname,Segment3={470},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate), -1)"}>}Closingbalance)+Sum({<Periodname,Segment3={480},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate), -1)"}>}Closingbalance)) /vThousand

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

1 Reply
Anil_Babu_Samineni

Try this

=(Sum({<Periodname,Segment3={440},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate)"}>}Closingbalance)+
Sum({<Periodname,Segment3={470},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate), -1)"}>}Closingbalance)+Sum({<Periodname,Segment3={480},ToDate={">=AddYears($(vStartDate), -1)<=AddYears($(vTillDate), -1)"}>}Closingbalance)) /vThousand

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful