Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Partner
Partner

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
Arjunarao
Honored Contributor II

Re: QTD,YTD,MTD on selection?

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)

)

)

)

Partner
Partner

Re: QTD,YTD,MTD on selection?

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

Partner
Partner

Re: QTD,YTD,MTD on selection?

Highlighted
Surya
New Contributor III

Re: QTD,YTD,MTD on selection?

That date field convert into num

eg: num(POSITION_DATE)

then you apply

Surya
New Contributor III

Re: QTD,YTD,MTD on selection?

That date field convert into num

eg: num(POSITION_DATE)

then you apply

MVP
MVP

Re: QTD,YTD,MTD on selection?

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

Arjunarao
Honored Contributor II

Re: QTD,YTD,MTD on selection?

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