I'm trying to make a bar chart which shows the stock value (Y-axis) of inactive items. I would like to show the number of items which have been inactive for longer than two months, for longer than four months, for lomger than six months etc. This is a reverse cumulative chart, as items which have been inactive for longer than 4 months have been evidently also been inactive for 2 months.
I've managed to make a dimension which divides months of inactivity into classes of two months:
dual(replace(class(V_R_ITEM_MonthsSinceLastUse,2),'<= x <','-'),class(V_R_ITEM_MonthsSinceLastUse,2))
This dimension expresses the classes in my chart like this:
Although the maths do work, the expression seems to suggest that items fall into restricted classes (i.e. "2-4") and that's not true. An item which has been inactive for 5 months falls into the same class as a item which has been inactive for 2 months (because this item has also been inactive for longer than two months), but the expresion of the classes my chart suggest that is does NOT belong to this class, as the class is expressed as "2-4" rather than ">2" or something. See attachements. The bars are fine; it's just the expression of classes along the X-axis which is not really what I'm looking for.
Num(Class(....)) converts the class statement by a number. I can't remember if it is the upper or lower bound of the class, but that gives you a starting point. Another option is to use SubField(Class(....), '<', -1) to get the upper bound and use this as the dimension value.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein