Yeah, it would help if we could tell if the conditions are different and/or the sales are different. As written, it's just sum(if(some condition,sales)), which is almost certainly not what you were asking about.
I'm not going to go through all four possibilities, so I'll just give you the rough idea. Set analysis has operators for union and exclusion, and some combination of these are likely what you want. Have a look at the help text for set analysis. Or give an actual example, and we can easily convert it to the set analysis equivalent.
Thanks for your help. I want to convert following nested if-else expression into set analysis :-
=sum(if(F1='FTD',if(year=vIndexYear and Month=vIndexMonth and Day=vIndexDay,amt), if(F1='MTD',if(year=vIndexYear and Month=(vIndexMonth) and Day<=vIndexDay,amt), if(F1='YTD',if(year=vIndexYear and new<=m,amt)))))
so that my chart will be looked like as follows :-
Before we even get into set analysis, you should realize that the IF statement as you wrote it is being evaluated for every row of the table, where part of it really only needs to be evaluated once. So you'd get some improvement by just moving parts of it outside of the sum:
=if(F1='FTD',sum(if(year=vIndexYear and Month=vIndexMonth and Day =vIndexDay,amt)) ,if(F1='MTD',sum(if(year=vIndexYear and Month=vIndexMonth and Day<=vIndexDay,amt)) ,if(F1='YTD',sum(if(year=vIndexYear and new<=m,amt)))))
And that's the basic structure I'd keep when converting to set analysis. I think the set analysis expression would be this (untested):