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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
zela9123
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
jwjackso
Specialist III
Specialist III

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
jwjackso
Specialist III
Specialist III

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

 

zela9123
Contributor
Contributor
Author

Thanks a lot, it is working.