Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can we calculate current quarter sales in qlikview?
Try this
Assuming you date format is 'DD-MM-YYYY'
=Sum({<Date = {">=$(=Date(Quarterstart(max(Date)),'DD-MM-YYYY'))<=$(=date(max(Date),'DD-MM-YYYY'))"}>}Sales)
It's not working.
I have a date field with date starting from Jan-2015 to Apr-2016, I need to pick last three month sales from this.
And also need to pick Last Quarter Sales?
Also
Try something like below
Load *,
IF(DayNumberOfQuarter(Date_field)<=DayNumberOfQuarter(Today()),1,0) as QTD_Flag
From .... Table;
and use this flag in Set Analysis
Sum({<QTD_Flag={'1'}>}sales) --> will give you current quarter to date sales
Thanks
Sasi
Try to share a qvw with sample data and explain your requirement against that, so that we can work on right data and for right requirement without having to have much guess work.
Below is the sample data:
I want the output to be as Current Three Month Sales that is sum of Feb-16, Mar-16 and Apr-16
and Current quarter Sales that is Jan-16, Feb-16, Mar-16
Date | Sales |
Jan-15 | 75 |
Feb-15 | 77 |
Mar-15 | 59 |
Apr-15 | 70 |
May-15 | 91 |
Jun-15 | 51 |
Jul-15 | 99 |
Aug-15 | 58 |
Sep-15 | 82 |
Oct-15 | 94 |
Nov-15 | 82 |
Dec-15 | 66 |
Jan-16 | 66 |
Feb-16 | 56 |
Mar-16 | 68 |
Apr-16 | 81 |
Hi,
Refer this expression -
sum({<Date = {'>$(=(date(AddMonths( date#(max(Date),'DD/MM/YYYY'),-3),'DD/MM/YYYY')))'}>}Sales)
Regards,
Akshay
Try this
Assuming you date format is 'DD-MM-YYYY'
=Sum({<Date = {">=$(=Date(Quarterstart(max(Date)),'DD-MM-YYYY'))<=$(=date(max(Date),'DD-MM-YYYY'))"}>}Sales)
PFA
Try Below,
Date(date#(Date,'MMM-YY'), 'YYYYMM') as Month_year;
For Latest quarter
=sum({<Month_year={">=$(=date(QuarterStart(max(Month_year),-1),'YYYYMM'))<=$(=date( QuarterEnd(max(Month_year),-1),'YYYYMM'))"}>}Sales)
For last Three Months
=sum({<Month_year={">=$(=date(addmonths(max(Month_year),-2),'YYYYMM'))<= $(=date(addmonths(max(Month_year),0),'YYYYMM')) "}>}Sales)