Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
My requirement is when I select Q4-2021 in filter I should get Q3-2021(measured value) in KPI object similarly when I select Q3-2021 I should get Q2-2021(measured value) in KPI object.
I have tried
count({<Date={">=$(=QuarterStart(Max(Date),-1))<=$(=QuarterEnd(Max(Date),-1))"}>} sales) as my measure
but got
Expected output:
Could you please help me to achieve the above requirement.
Thanks
Hi @128718 ,
Please follow the below steps to get the required output.
1. Create new dimension in the script as Ceil(Month(SatrtDate)/3) as Quart
2. Create 2 variables as maxq with expression : =max(Quart) and PrevQ as expression : =max(Quart)-1
3. write a expression in KPI as measure for current Quarter : count({<Quart={"$(maxq)"}>}ID) and
prev Quarter as count({<Qart={"$(PrevQ)"}>}ID)
Hope this helps you.
HI @128718 ,
Try below set analysis
above(sum({<InvoiceDate={">=$(=QuarterStart(Max(InvoiceDate)))<=$(=QuarterEnd(Max(InvoiceDate)))"}>} [#TransactionCount]) )
Thanks for your reply.
I have tried the above expression however it is not working
Can you share a dataset.
Also, like to understand the formula behind the quarter field.
Please find the dataset
Quarter | ID | Date | SatrtDate | EndDate |
01/01/2021to31/03/2021 | xxx | 03-01-2021 | 01-01-2021 | 31-03-2021 |
01/04/2021to30/06/2021 | aaa | 05-05-2021 | 01-04-2021 | 30-06-2021 |
01/07/2021to30/09/2021 | bbb | 03-07-2021 | 01-07-2021 | 30-09-2021 |
01/07/2021to30/09/2021 | yyy | 08-08-2021 | 01-07-2021 | 30-09-2021 |
01/07/2021to30/09/2021 | ccc | 06-08-2021 | 01-07-2021 | 30-09-2021 |
01/01/2021to31/03/2021 | zzz | 28-02-2021 | 01-01-2021 | 31-03-2021 |
01/04/2021to30/06/2021 | qqq | 08-04-2021 | 01-04-2021 | 30-06-2021 |
01/04/2021to30/06/2021 | sss | 01-05-2021 | 01-04-2021 | 30-06-2021 |
01/01/2021to31/03/2021 | ddd | 27-03-2021 | 01-01-2021 | 31-03-2021 |
Quarter field is the concatenation of Startdate and Enddate
Hi @128718 ,
Please find attached QVF file. I hope you will get your answer.
Sorry I am not getting the exact output. Please find the dataset and output
Quarter | ID | Date | SatrtDate | EndDate |
01/01/2021to31/03/2021 | xxx | 03-01-2021 | 01-01-2021 | 31-03-2021 |
01/07/2021to30/09/2021 | aaa | 05-05-2021 | 01-07-2021 | 30-09-2021 |
01/07/2021to30/09/2021 | bbb | 03-07-2021 | 01-07-2021 | 30-09-2021 |
01/07/2021to30/09/2021 | yyy | 08-08-2021 | 01-07-2021 | 30-09-2021 |
01/07/2021to30/09/2021 | ccc | 06-08-2021 | 01-07-2021 | 30-09-2021 |
01/01/2021to31/03/2021 | zzz | 28-02-2021 | 01-01-2021 | 31-03-2021 |
01/04/2021to30/06/2021 | qqq | 08-04-2021 | 01-04-2021 | 30-06-2021 |
01/04/2021to30/06/2021 | sss | 01-05-2021 | 01-04-2021 | 30-06-2021 |
01/01/2021to31/03/2021 | ddd | 27-03-2021 | 01-01-2021 | 31-03-2021 |
Expected Ouput
Quarter | Count of Ticket | Count of Ticket for Previous Quarter |
01/01/2021to31/03/2021 | 3 | - |
01/04/2021to30/06/2021 | 2 | 3 |
01/07/2021to30/09/2021 | 4 | 2 |
It would be great help if you solve it.
Thanks
Hi,
Please use below expression
Count of Ticket : Aggr(count(ID),Quarter)
Count of Ticket for Previous Quarter : Above(total Aggr(count(ID),Quarter))
Hi @abhijitnalekar ,
Thank you for your help, in table it is working fine but my requirement is when I chose the Quarter in filter I should be showing previous quarter value in KPI object.