Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I sum a range values from a subset of months from within the range?

Hi

If I have a sales funnel table with two columns

  1. Month
  2. Value

And data organised like this:

Month     Value

Jan-17     £2400

Feb-17     £500

Mar-17     £12000

Apr-17     £20

May-17     £4000

Jun-17     £1000

What expression do I use to limit the sum value to only Jan-17 to Apr-17?

Thank you

21 Replies
sunny_talwar

May be like this

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='£#,##0.00;-£#,##0.00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET FirstWeekDay=0;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='en-GB';

SET CreateSearchIndexOnReload=1;

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

LOAD

    "Expected Comp. Opp." as "End date",

    "Last Change",

    "Start date",

    "Opportunity ID",

    "Quote ID",

    "Customer Area" as "Sales Area",

    "Market Segment" as "Market Sector",

    "Org Division" as Division,

    Prospect as Customer,

    F10 as ERP,

    "CRM Product category" as Product,

    "Employee Responsible" as "Account Manager",

    Phase,

    "Phase Since",

    Status,

    "Status Since",

    "Win probability (%)",

    £ as "Opp value",

    £1,

    Region,

    "End Month",

    "Last Mod Month",

    "Start Month",

    "PWP"

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [P8C Funnel]);

LOAD

    Date(Date#("Fiscal year/period", 'MMM-YY'), 'MMM-YY') as "Month",

    "Sales document" as "Sales order_OR",

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F7 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Order value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Orders received]);

LOAD

    Date(Date#("Fiscal year/period", 'MMM-YY'), 'MMM-YY') as "Month",

    "Sales document" as "Sales order_OO",

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F7 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Open order value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Open orders]);

LOAD

   Date(Date#("Fiscal year/period", 'MMM-YY'), 'MMM-YY') as "Month",

    "Sales document" as Invoice,

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F8 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Invoice value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Revenue]);

LOAD

    "Account Manager",

    "Orders Target",

    "Revenue Target",

    "Sales Region" as Region,

    "Sales Area",

    "42644",

    "42675",

    "42705",

    "42736",

    "42767",

    "42795",

    "42826",

    "42856",

    "42887",

    "42917",

    "42948",

    "42979"

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, table is [Individual targets]);

LOAD

    "Goal month",

    "Academia goal",

    "Industry goal",

    "Academia actual",

    "Industry actual",

    Service

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, table is [Month targets]);

OmarBenSalem

LOAD

    "Expected Comp. Opp." as "End date",

    "Last Change",

    "Start date",

    "Opportunity ID",

    "Quote ID",

    "Customer Area" as "Sales Area",

    "Market Segment" as "Market Sector",

    "Org Division" as Division,

    Prospect as Customer,

    F10 as ERP,

    "CRM Product category" as Product,

    "Employee Responsible" as "Account Manager",

    Phase,

    "Phase Since",

    Status,

    "Status Since",

    "Win probability (%)",

    £ as "Opp value",

    £1,

    Region,

    "End Month",

    "Last Mod Month",

    "Start Month",

    "PWP"

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [P8C Funnel]);

load *,

Date(date#(Month,'MMM-YY'),'MMM-YY') as FinalMonth;

LOAD

    "Fiscal year/period" as "Month",

    "Sales document" as "Sales order_OR",

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F7 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Order value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Orders received]);

DROP FIELD Month;

load *,

Date(date#(Month,'MMM-YY'),'MMM-YY') as FinalMonth;


LOAD

    "Fiscal year/period" as "Month",

    "Sales document" as "Sales order_OO",

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F7 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Open order value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Open orders]);

DROP FIELD Month;

load *,

Date(date#(Month,'MMM-YY'),'MMM-YY') as FinalMonth;

LOAD

    "Fiscal year/period" as "Month",

    "Sales document" as Invoice,

    "Customer group 3" as "Sales Area",

    "Customer group 1" as "Market Sector",

    Division,

    "(AG) Sold-To Party" as Customer,

    F8 as ERP,

    "(ZA) Sales Rep." as "Account Manager",

    £ as "Invoice value",

    Region

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, header is 1 lines, table is [BW Revenue]);

DROP FIELD Month;

LOAD

    "Account Manager",

    "Orders Target",

    "Revenue Target",

    "Sales Region" as Region,

    "Sales Area",

    "42644",

    "42675",

    "42705",

    "42736",

    "42767",

    "42795",

    "42826",

    "42856",

    "42887",

    "42917",

    "42948",

    "42979"

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, table is [Individual targets]);

LOAD

    "Goal month",

    "Academia goal",

    "Industry goal",

    "Academia actual",

    "Industry actual",

    Service

FROM [lib://General Dashboard/Dashboard Workbook.xlsm]

(ooxml, embedded labels, table is [Month targets]);