Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
syedsaqib
Contributor II
Contributor II

Count Remaining Period in a Quarter

Hello Everyone,

Can someone please help me with Formula to calculate remaining period in each quarter in Qliksense.

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! 

 

syedsaqib_0-1591998286648.png

 

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra
Master II
Master II

@syedsaqib 

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

View solution in original post

8 Replies
Vegar
Partner
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
Taoufiq_Zarra
Master II
Master II

@syedsaqib  other option :

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

 

Taoufiq_ZARRA_0-1592001148176.png

 

Taoufiq_ZARRA_1-1592001160852.png

 

Taoufiq_ZARRA_2-1592001179499.png

 

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Vegar
Partner
Partner

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Taoufiq_Zarra
Master II
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") 😉
syedsaqib
Contributor II
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

 

Vegar
Partner
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
Taoufiq_Zarra
Master II
Master II

@syedsaqib 

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

View solution in original post

syedsaqib
Contributor II
Contributor II
Author

Thanks. You guys are really helpful.