Skip to main content

App Development

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

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

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

What if you try something like this? 

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

Taoufiq_Zarra

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

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

Taoufiq_Zarra

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

Taoufiq_Zarra

@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") 😉
syedsaqib
Contributor II
Contributor II
Author

Thanks. You guys are really helpful.