Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kostiskampouris
Contributor II
Contributor II

sum for current month

Hello everyone,

I Have a table with daily report of every store about the quantity.

I have created a pivot table with dimension the store name and expression the qty .

(the user has to select the day(dd/mm/yyyy) from a listbox and the chart will show the quantity for that day for every store.

The next expression I want to be the total  quantity from the beggining of the month of the selected date until the selected date.

For example the user selects 04/12/2017 and the resutl of the 2nd expression  must be the total quntity from 01/12/2017 until 04/12/2017.

For 3rd expression the YTOD quantity.

How can I write the expressions using set analysis ?

Thank you in advance

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Perhaps this?

1) Sum(Measure)

2) Sum({<DateField = {">=$(=MonthStart(Max(DateField))) <=$(=Max(DateField))"}>} Measure)

3) Sum({<DateField = {">=$(=YearStart(Max(DateField))) <=$(=Max(DateField))"}>} Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

4 Replies
Anil_Babu_Samineni

Perhaps this?

1) Sum(Measure)

2) Sum({<DateField = {">=$(=MonthStart(Max(DateField))) <=$(=Max(DateField))"}>} Measure)

3) Sum({<DateField = {">=$(=YearStart(Max(DateField))) <=$(=Max(DateField))"}>} Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
its_anandrjs

Can you explain with any example.

mayuresh_d
Partner - Creator
Partner - Creator

use expression which anil has given but make sure you will conform proper date format or else it will not wok.

ty

kostiskampouris
Contributor II
Contributor II
Author

Thank you Anil your  suggetion works fine.