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

Calculate sum of costs for variable number of months

Hi,

I got a data set and I am calculating the Variance of Actual vs Budgeted Sales.

Assume the financial year is from July 1st to June 30th of the following year. Please refer the below sample data set for product A's sales details. (For simplicity, I am recording the sales values at the end of each month).

Product A Sales
Product_IDSales MonthActual SalesBudgeted Sale
P_10031/July/2017100120
P_10031/August/2017115125
P_10030/September/2017150125
P_10031/October/2017125120
P_10030/November/2017120115
P_10031/December/2017135120
P_10031/January/2018120125
P_10028/February/2018140125
P_10031/March/2018110125
P_10030/April/2018105125
P_10031/May/2018125130
P_10030/June/2018120120
P_10031/July/2018125125
P_10030/August/2018
130
P_10030/September/2018130
P_10031/October/2018120
P_10030/November/2018120
P_10031/December/2018130
P_10031/January/2019125
P_10028/February/2019130
P_10031/March/2019125
P_10030/April/2019125
P_10031/May/2019130
P_10030/June/2019125

The above data set got two years of data and my requirements are;

1. When I open the app, I want to see the below table information about the sales for Product A.

Calculate the sum of actual Sales, sum of budgeted sales and variance  as shown below from 31/July/2017 to 31/July/2018.

Product_IDActual SalesBudgeted SalesVariance
P_1001465147510

Note

When adding the budgeted sales values, I want to display the sum of budgeted sales from 31/July/2017 to 31/July/2018 and the variance also should be from 31/July/2017 to 31/July/2018 (last month).

I am using a master calendar in my app.

2. Assume I got Year and the respective month on the app visualization window using a filter pane so that a user can select a fiscal year and a month to visualize the respective Year's and Month's data. Suppose a user selects year as 2018 and the month as January, the above table should depict the sales information for the selected criteria as shown below,

  

Product_IDActual SalesBudgeted SalesVariance
P_1001201255

Could anyone help me with the above which I wanted to achieve since some time.

Appreciate, even someone could help me to accomplish at least part of the tasks.

Thanks in advance and it would be a great help for me.

Kind regards,

Andy

12 Replies
andymanu
Creator II
Creator II
Author

Hi Paola,

Thanks a lot for your reply.

If you don't mind, could you please send me the .qvf file for me to go through?

Thanks a lot.

Kind regards,

Andy

paola_valenti
Creator
Creator

I attached my modified app in my last post.

I have attached it also in this reply.

Here I have changed file name (SumOfCost2), so there could not be confusion.

andymanu
Creator II
Creator II
Author

Hi Paola,

Sorry for the inconvenience created.

I saw the attached document later and apologies for that.

Kind regards,

Andy