Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marcoyukon
Creator
Creator

Prior Month Total Set Expression Issue

I have the following set expression. If I use the {1} as the set identifier I get the previous mt total, however the issue I am having is that ANY other dim selections will be disregarded, which is not desirable.

PriorMonth =COUNT( DISTINCT

                    {1<

                        [DateType]={'Refs'},

                        [CanonicalDate.Calendar.YearMonth]={'$(vPreviousCalendarMonth)'}

                    >} RefId )

I've tried to change the set identifier to {$} and also changed the date dimension attribute to ignore, but didn't work. I get zeros for the prior month.

=COUNT( DISTINCT

                    {$<

                        [DateType]={'Refs'},

                        [CanonicalDate.Calendar.YearMonth]=,

                        [CanonicalDate.Calendar.YearMonth]={'$(vPreviousCalendarMonth)'}

                    >} RefId )

Is there a way to ignore the YearMonth and still use any other selections ?

3 Replies
marcelviegas
Creator II
Creator II

Manda o qvw ai se poder.

dwforest
Specialist II
Specialist II

Separate the set expression

PriorMonth =COUNT( DISTINCT

                    {1<[CanonicalDate.Calendar.YearMonth]={'$(vPreviousCalendarMonth)'}> *

                       $<[DateType]={'Refs'}>} RefId )

It's been a while, you may also have to include every field that you want selection to impact, in the second part,e,g, Department=

sunny_talwar

How about this

=Count(DISTINCT {1<[DateType]={'Refs'}, [CanonicalDate.Calendar.YearMonth]={'$(vPreviousCalendarMonth)'}>} RefId) * Avg(1)