I guess my question is what is your dimension here? Is it Year dimension dimension? If it is then you won't be able to just use set analysis to get the result on the same line. For that you will have to use Above() or Below() function. I think if you can provide a sample which somewhat matches what your real scenario is, we might be able to help you better
Thanks for your responses. I am sorry not to add a dimension to my example. I just added the customer dimension to it. Please see the attach file.
Settu, You are right! there is syntax errors in the calculation that i posted for the previous year calculation. But the original calculation i made in qlikview is same as you. So, i guess there is no issue on that. I am suspecting that that the way i created the PreviousMonthYear variable is not the right way to calculate it and thats why its not working in this particular situation i am trying to handle.
Thanks for the reply and the solution. The apps you attached works perfectly fine and its working as expected. But when i apply that in my real application it does not work for some reason. I just couldnt find the reason why it shouldnt work. Could you please give me some suggestions based on your experience where i am doing wrong what could possibly go wrong in this particular situation? Even though i totally understand that without looking at the real apps its quite impossible to say whats going wrong with the apps.
Btw, Could you please explain what is this expression doing to calculate the Previous Year sales?
Thanks again for your reply. The attachment you posted works perfect but i cant make that work in my original application. I dont understand why its not working. Could you copy your email here? May be i could show you a fraction of the original data and you could tell me the issue. Please ignore this message if you dont share email.