Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I struck in one place , my requirement is chart has to be display max month sales that some time current month sales is zero then it has to be displayed previous month sales.
if the previous month and current month sales is zero then it has to be displayed last to last month sales like that it has to be show.
please guide me how to do this .
below formula i am using
if((sum({<Year = {'$(=max(Year))'},[Month]={'$(=max([Month]))'},Status={'F'}>}Stock))=0,
sum({$<Year = {'$(=max(Year))'},Status={'F'}>}Stock),
sum({$<Year = {'$(=max(Year))'},[Month]={'$(=max([Month]))'},Status={'F'}>}Stock)
)
thanks in advanced
if your data model has MonthYear field try :
sum({$<MonthYear={"$(=Date(Max(MonthYear),'MMM-YY'))"},Status={'F'}>} Stock )
HTH
Vikas
Niranjan,
Your approach to expression might not give you expected result even for when maximum month has data. And that is simply because max year might not have data for max month always. To explain better, - max(month) would possibly always be 12/Dec. However for max/current year you might not have data for Dec. That means, when you calculate max month - either calculate taking into consideration the fact that - that should be from max year that has data, or calculate month using Date field instead where data is there. If you consider 'when data is there' i.e. in set analysis '=Sum(Stock)>0' your max month/date would itself take care of max month/prev month to max month or so.
Hope this helps.
Hi vikashmahaja,
Thanks for replay.
There is year and month is different fields, i concatenated fields in backend i tried it is not working.
Thanks
@niranjan_capgemnini wrote: ..if user select at a time jan and Feb then user expectation only feb month stock.
thats why i wrote the above calculated field...
Sorry, I could not follow or did not find that this could result in an expression you wrote. Could you share a sample app to work on?