Here variable vMonthCalc keeps track of the interval between current month and the beginning of the year by checking a date field. (I.E. for 01.01.2018 it holds 0, for 01.02.2018 it holds 1, 01.11.2017 it holds 10 and so on).
And I have two products in my Products field, A and B. I only need to calculate total amount of sales for product A since the beginning of the year. But my function as you can imagine gives me the total sales for product A and B.
Date Products Sales
01.01.2018 A 20
01.01.2018 B 30
01.02.2018 A 10
01.02.2018 B 20
The function holds 50 for January and 80 for February. But I need to hold 20 for January and 30 for February.
I tried to use an if condition everywhere in the formula but couldn't succeed.
Can anyone help me where to put an if condition or how to make a set analysis for this condition ?