Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

KPI - MTD view

Hi All,

Please see below sample data set:

zela9123_1-1595796502958.png

Based on that data, I would like to create 3 KPI's which will be showing Month to Date view for each of the product. So for example for KPI - Product X, it should display 17, for Product Z: 9.. etc. What is more, I would like to have it responsive - when I am changing view from current month to, for example June, it should also show sum of prices per specific product (MTD view for selected month).

I am able to display sum of all prices per each product by using below expression: 

Sum({<Product="X">} [Price])

but I don't know how to change it to MTD view.

 

I look forward to hearing from you.

 

 

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

Using the data below:

Data:
Load Date#([Date],'YYYY-MM') as [Date],
     Product,
     Price;
Load * Inline [
Date,Product,Price
2020-05,X,1
2020-05,Y,2
2020-05,Z,3
2020-06,X,4
2020-06,Y,5
2020-06,Z,6
2020-07,X,7
2020-07,Y,8
2020-07,Z,9
2020-07,X,10
];

Using this formula:  =Sum({<Product={'X'},[Date]={'$(=Max(Date([Date],'YYYY-MM')))'}>}[Price])

 

maxdate.PNG

 

View solution in original post

2 Replies
Highlighted
Specialist II
Specialist II

Using the data below:

Data:
Load Date#([Date],'YYYY-MM') as [Date],
     Product,
     Price;
Load * Inline [
Date,Product,Price
2020-05,X,1
2020-05,Y,2
2020-05,Z,3
2020-06,X,4
2020-06,Y,5
2020-06,Z,6
2020-07,X,7
2020-07,Y,8
2020-07,Z,9
2020-07,X,10
];

Using this formula:  =Sum({<Product={'X'},[Date]={'$(=Max(Date([Date],'YYYY-MM')))'}>}[Price])

 

maxdate.PNG

 

View solution in original post

Highlighted
Contributor
Contributor

Thanks a lot, it is working.