# App Development

Announcements
An issue has been identified on Qlik Cloud hub, please visit our Status Update Page for details: GET THE LATEST
cancel
Showing results for
Did you mean:
Contributor II

## Count Remaining Period in a Quarter

Hello Everyone,

For Example, If Current Period selection is 7 , which means I am in Quarter 3 and I should get remaining period = 2 (because period 8 and period 9 is to go in this quarter).

I have provided example for Quarter 1 and Quarter 3 in below screenshot.

Thanks!

Labels (1)
• ### COUNT Parameters

1 Solution

Accepted Solutions

@Vegar  well explained, I only add qvf example in attached

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
8 Replies
MVP

What if you try something like this?

Max({<Period, [Qtr no] = {\$(=max([Qtr no])} >} Period) - max([Qtr no])

@syedsaqib  other option :

``=count({1<[Qtr No.]=p([Qtr No.]),Period={">\$(=GetFieldSelections(Period))"}>} Period)``

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
MVP

Nice one @Taoufiq_Zarra. I choose this one my previous suggestion.

Thanks @Vegar  😉

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Contributor II
Author

ThanksTaoufiq ,

It's not working as shown in your screenshot.

Could you please explain this part of your formula?  1<[Qtr No.]=p([Qtr No.])

Regards,

Syed

MVP

1 tells the expression to consider the whole set, not only your selected set.

[Qtr No.]=p([Qtr No.] tells the expression to reduce your set to only consider the Qtr No. that are available in your current selection. An alternative to this modifier to ensure only one Qtr No. could be to use [Qtr No.]= {"\$(=max([Qtr No.])" )

@Vegar  well explained, I only add qvf example in attached

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Contributor II
Author

Thanks. You guys are really helpful.

Tags
Community Browser