Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I am creating YOY Sales in the Backend using PEEK function to get the Previous Year Value.
This works fine, the first entry of the Year appears as'-' in the data model for PrevYr as expected.
But, when i create a chart basis this the PrevYr ,it appears as Zero on the First Year though it is supposed to be '-' when i use it inside Sum like Sum(PrevYr) but , if use just PrevYr as the expression it results with '-'
I would like to get '-' for the first entry as there is no previous year for it , even if i use Sum function.
Can someone please suggest how this could be done
I'm not sure if it's possible at least not without any ugly side-effects ... you may use:
If(Len(concat(PrevYr, ','))=0, dual('-', 0) , Sum(PrevYr ))
or
If(Len(concat(PrevYr, ','))=0, dual('-', min/max(total aggr(Sum(PrevYr ), Dim1, Dim2)) +-1) , Sum(PrevYr ))
but it will for example make trouble in totals and might be there calculated different - maybe by querying the levels with dimensionality() or ...
- Marcus
it is not working
You could not take the suggestion 1:1 because it's just a generic example to show which various measures might be useful. It needs the appropriate adjustments to your data-structure, fieldnames and a valid syntax.
- Marcus