Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Quarter Data

How can we calculate current quarter sales in qlikview?

1 Solution

Accepted Solutions
MVP
MVP

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)

View solution in original post

11 Replies
Champion III
Champion III

Not applicable

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?

Specialist III
Specialist III

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

MVP
MVP

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.

QlikCommunity Tip: How to get answers to your post?

Not applicable

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

DateSales
Jan-1575
Feb-1577
Mar-1559
Apr-1570
May-1591
Jun-1551
Jul-1599
Aug-1558
Sep-1582
Oct-1594
Nov-1582
Dec-1566
Jan-1666
Feb-1656
Mar-1668
Apr-1681
Contributor II
Contributor II

Hi,

Refer this expression -

sum({<Date = {'>$(=(date(AddMonths( date#(max(Date),'DD/MM/YYYY'),-3),'DD/MM/YYYY')))'}>}Sales)

Regards,

Akshay

MVP
MVP

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)

View solution in original post

MVP
MVP

PFA

Specialist III
Specialist III

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)