Question
· Jan 9, 2023

Using %GetDimensionMembers with filters

does anyone have an example of using %DeepSee.Utils:%GetDimensionMembers where you want to apply certain filters

For example I have a date dimension that I want to get all of the months level but filtering for only a specific year.

Thanks

Product version: IRIS 2022.2
Discussion (2)2
Log in or sign up to continue

Hi Jenna,

Is something like this what you have in mind?

SAMPLES>set relatedFilters("[DateOfSale].[Actual].[YearSold]") = "&[2021]"
 
SAMPLES>set sc = ##class(%DeepSee.Utils).%GetDimensionMembers("HOLEFOODS","[DateOfSale].[Actual].[MonthSold]","filter",.members,,.memberClass,.relatedFilters)
 
SAMPLES>zwrite members                                                         
members(1)=$lb("[NOW]","NOW","NOW","NOW")
members(2)=$lb("[Jan-2021]","Jan-2021","202101","202101","")
members(3)=$lb("[Feb-2021]","Feb-2021","202102","202102","")
members(4)=$lb("[Mar-2021]","Mar-2021","202103","202103","")
members(5)=$lb("[Apr-2021]","Apr-2021","202104","202104","")
members(6)=$lb("[May-2021]","May-2021","202105","202105","")
members(7)=$lb("[Jun-2021]","Jun-2021","202106","202106","")
members(8)=$lb("[Jul-2021]","Jul-2021","202107","202107","")
members(9)=$lb("[Aug-2021]","Aug-2021","202108","202108","")
members(10)=$lb("[Sep-2021]","Sep-2021","202109","202109","")
members(11)=$lb("[Oct-2021]","Oct-2021","202110","202110","")
members(12)=$lb("[Nov-2021]","Nov-2021","202111","202111","")
members(13)=$lb("[Dec-2021]","Dec-2021","202112","202112","")

I'll admit I'm not completely sure why the NOW member is coming back in this case, since there shouldn't be any data with a year of 2021 and a month of NOW, but other than that I think this may be what you were describing.