Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)