Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
alexshaji
Contributor
Contributor

Current FYQ

HI Members,

I have quite a few places in the Dashboard where I need to display the current and previous quarter results. My project follows the FYQ as:

Nov - Jan = Q1
Feb - Apr=Q2
May - Jul=Q3
Aug - Oct=Q4

The table has the following:

Cust IDSalesFYQSalesDateBusiness UnitSales Amount
121FY16 Q224-03-2016ABC12000
123FY17 Q116-12-2017AAV2000
142FY20 Q121-11-2020GBC500
116FY20 Q2...AAA6897
1220FY20 Q3.......7789
136FY20 Q4......69369
400FY21 Q1.......421
422FY22 Q2......1589

 

Now Ideally every Quarter the display will need to change. FIr examples this quarter

Current Qtr Sales                               Previous Qtr Sales

FY20 Q469369                                 FY20 Q3 = 7789

How can I achieve this? Please help me

Labels (1)
4 Replies
alexshaji
Contributor
Contributor
Author

Guys

Kushal_Chawda

Create variables like below

vCurrentQuarterStart = date(quarterstart(max(SalesDate),0,11))

vCurrentQuarterEnd = date(quarterend(max(SalesDate),0,11))

vPreviousQuarterStart = date(quarterstart(max(SalesDate),-1,11))

vPreviousQuarterEnd = date(quarterend(max(SalesDate),-1,11))

 

Now you can use below expression to get the sales amount

Sum({<Quarter, Month,Week, SalesDate,SalesDate={">=$(vCurrentQuarterStart)<=$(vCurrentQuarterEnd)"}>}SalesAmount)

Sum({<Quarter, Month,Week, SalesDate,SalesDate={">=$(vPreviousQuarterStart)<=$(vPreviousQuarterEnd)"}>}SalesAmount)
alexshaji
Contributor
Contributor
Author

Thanks Kush. I am getting the Sum of current and previous qtrs exactly as I need. One more thing that I would request is the Header for this which also should be Dynamic.

So in the KPI i can use 

FY20 Q4                      FY20 Q3

69369                          7789

Kushal_Chawda

may be below

// Current Quarter
='FY'& date(quarterstart(max(SalesDate),0,11),'YY')&' '&
'Q'&ceil(month(quarterstart(max(SalesDate),0,11))/3)

// Previous Quarter
='FY'& date(quarterstart(max(SalesDate),-1,11),'YY')&' '&
'Q'&ceil(month(quarterstart(max(SalesDate),-1,11))/3)