Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shreya_nadkarni
Partner - Creator
Partner - Creator

QTD,YTD,MTD on selection?

Hi Everyone,

Wanted to know if this is the proper way to calculate data on selection of filter YTD,QTD,MTD. Or is there any other way how i can do it?Thanks for your suggestions.

if(Filter='YTD' or GetSelectedCount(Filter)=0,

only({<POSITION_DATE= {">=$(=vytdstart)<=$(=vytdend)"}>} maturity)

,

if(

Filter='MTD',

only({<POSITION_DATE= {">=$(=vmtdstart)<=$(=vmtdend)"}>} maturity),

IF(Filter='QTD',

only({<POSITION_DATE= {">=$(=vqtdstart)<=$(=vqtdend)"}>} maturity)

)

)

)

Thanks,

Shreya

7 Replies
qlikviewwizard
Master II
Master II

Use Sum instead of ONLY, Your expression logic is correct:

if(Filter='YTD' or GetSelectedCount(Filter)=0,

Sum({<POSITION_DATE= {">=$(=vytdstart)<=$(=vytdend)"}>} maturity)

,

if(

Filter='MTD',

Sum({<POSITION_DATE= {">=$(=vmtdstart)<=$(=vmtdend)"}>} maturity),

IF(Filter='QTD',

Sum({<POSITION_DATE= {">=$(=vqtdstart)<=$(=vqtdend)"}>} maturity)

)

)

)

shreya_nadkarni
Partner - Creator
Partner - Creator
Author

Hi arjun,

the maturity field has dates so we want to use only of the maturity/segment.

Also i am facing out of memory issue.Is there any other way to handle it.Thanks

shreya_nadkarni
Partner - Creator
Partner - Creator
Author

Surya
Creator II
Creator II

That date field convert into num

eg: num(POSITION_DATE)

then you apply

Surya
Creator II
Creator II

That date field convert into num

eg: num(POSITION_DATE)

then you apply

tresesco
MVP
MVP

Try to share an app with sample data replicating your ask. That way, we would be able to help you better and faster.

qlikviewwizard
Master II
Master II

It is much to share the sample data to provide exact solution.shreya.nadkarni