Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

dvalenti
New Contributor II

Sum values of max date of period

Hello,

I need to develop a measure in Qlik Sense that sums the product quantities of the last day of the period. Here goes some explanation of the measure and visualization:

  • The period of visualization can change, it can be: Year, Month, Quarter, Week, Day ...
  • The database has the information of quantity of products per day

Here goes some examples:

Database:

Date (MM/DD/YY)ProductQuantity
01/01/18A10
01/01/18B20
01/01/18C30
01/15/18A5
01/15/18B50
01/15/18C100
01/15/18D80
02/01/18A5
02/01/18B15
02/01/18C20
02/08/18A15
02/08/18B30
02/08/18C30
02/08/18D50

So lets see some visualizations that I would like:

Visualization 1:

Date (MM/DD/YY)Quantity
01/01/1860
01/15/18235
02/01/1855
02/08/18

110

Visualization 2:

MonthQuantity
Jan235
Feb110

Visualization 3: (This one uses the max date, in this case 02/08/2018)

ProductQuantity
A0
B30
C30
D50

Visualization 4:

MonthProductQuantity
JanA5
JanB50
JanC100
JanD80
FebA0
FebB30
FebC30
FebD50

I think it is not a good idea to use AGGR, because the database is very big and there are more information about the products that can be put in the visualization. Can anyone help me?

Thanks in advance.

Daniel

Tags (1)
2 Replies
thiago_justen
Valued Contributor III

Re: Sum values of max date of period

What about this:

Capturar.PNG

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
big_dreams
Contributor III

Re: Sum values of max date of period

Hi,

Create Year, Month,quarter, week ,day field in script based on date field

then

for 1:

dimension : Date

Expression : Sum(Quantity)

for 2:

dimension : Month

Expression : Sum(Quantity)

for 3:

dimension : product

Expression : Sum({<Date={"=$(=max(Date))"}>}Quantity)

for 4:

dimension : Month, Product

Expression : Sum(Quantity)

Regards,

Community Browser