Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
madhuqliklondon
Creator II
Creator II

Count of orders as of order value

  Hi all

    

I am trying to count no of orders under certain amount based on the month year. I have created monthyear based on order date and now trying to count orders under £30 ,£40 and so on.
Please find the example below

Data

    

Order_dateSample_order_numberTotal_amount
12.12.20171234535
15.01.201867891039
25.02.20181357945

Result:

MonthyearDec-17Jan-18Feb-18
Over £30111
Over £40 001

Thank you

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Orders:

Load

*,

Date(MonthStart(OrderDate),'MMM-YY') as OrderMonthYear

Inline

[

OrderDate, OrderNumber, OrderAmount

12/12/2017, 111, 35

15/01/2018, 222, 39

20/02/2018, 333, 45

];


KPI:

Load * Inline

[

KPI

Over £30

Over £40

];

Now create a Pivot Table

Dimension

KPI

OrderMonthYear (use this as column by drag and drop of pivot table functionality)

Expression

SUM(Aggr(IF(KPI = 'Over £30' and SUM(OrderAmount) >= 30, 1,

IF(KPI = 'Over £40' and SUM(OrderAmount) >= 40, 1)),OrderNumber,OrderMonthYear,KPI))

QVW enclosed for your reference.

View solution in original post

4 Replies
gerry_hdm
Creator II
Creator II

you a using  Intervallmatch

madhuqliklondon
Creator II
Creator II
Author

No,I am not using intervalmatch

MK_QSL
MVP
MVP

Orders:

Load

*,

Date(MonthStart(OrderDate),'MMM-YY') as OrderMonthYear

Inline

[

OrderDate, OrderNumber, OrderAmount

12/12/2017, 111, 35

15/01/2018, 222, 39

20/02/2018, 333, 45

];


KPI:

Load * Inline

[

KPI

Over £30

Over £40

];

Now create a Pivot Table

Dimension

KPI

OrderMonthYear (use this as column by drag and drop of pivot table functionality)

Expression

SUM(Aggr(IF(KPI = 'Over £30' and SUM(OrderAmount) >= 30, 1,

IF(KPI = 'Over £40' and SUM(OrderAmount) >= 40, 1)),OrderNumber,OrderMonthYear,KPI))

QVW enclosed for your reference.

Anonymous
Not applicable

Another Expression that can be helpful:

temp:

Load * Inline [

Order_date,Order_no,Amount

'12/12/2017','12345','35',

'01/15/2018','23467','39',

'02/25/2018','6578','45'

];


Data:

Load Order_date,

Order_no,

Amount,

MonthName(Date(Order_date)) as MonthYear


Resident [temp];


Drop Table temp;


Limit:

Load * Inline

[Limit

'30',

'40']


Create Pivot table with:

Row : Limit

Column: MonthYear

Measure: Sum(if(Amount>Limit,1,0))