# App Development

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
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
Master II

@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
Partner

What if you try something like this?

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Master II

@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") 😉
Partner

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Master II

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

Partner

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.])" )

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Master II

@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