#SOLVED I am Struggling with a Slice Row Fil...

#SOLVED

I am Struggling with a Slice Row Filter Condition

Scenario: I have Club Members that can renew their subscriptions Annually. I create a record for each year and have an โ€œExpiredโ€ status on the old record and the new record status is โ€œValidโ€ (for 365 days)

I want to create a Slice for a โ€œReminderโ€ Report that will run daily and check per the VisitorID if they have a โ€œValidโ€ Year Permit or not. I want to ONLY send the Report to the Club Members that have their latest Record (by date) as โ€œExpiredโ€

I am basing the Report on a Slice and I am trying to Filter the Slice to give me the appropriate data that the Report will use.

My Slice Row Filter Formula: TOP(ORDERBY(FILTER(Permit, AND([PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€), NOT([PermitStatus] = โ€œValidโ€), SELECT(Permit[PermitDate],[VisitorID]=[_THISROW].[VisitorID]), [PermitDate]) ), [PermitDate], TRUE),1)

Gives me error: โ€œInvalid structure: subexpressions must be Yes/No conditionsโ€

Any suggestions?

0 17 548
17 REPLIES 17

Why donโ€™t you just slice the data with the Expired value?

@Aleksi_Alkio because there could already be a โ€œValidโ€ one created and I do not want to send a reminder Email if that is the case. So I want to make sure the list of records that I have for a Year Visitor selects the latest one and then ONLY send an Email if that Status is โ€œExpiredโ€. The latest one could be โ€œValidโ€ and then no email must be sent. Scenario is that for the past 3 years this Visitor could have renewed his Year Membership and I keep the history e.g. ~ Current 365 Days - โ€œValidโ€ ~ Previous 365 Days - โ€œExpiredโ€ ~ Previous Previous 365 Days - โ€œExpiredโ€ etc.

@Aleksi_Alkio ok I removed the SELECT by rewriting the Formula in the VC of the Visitor Table to readโ€ฆ=MAXROW(Permit, PermitDate, AND([VisitorID] = [_THISROW].[VisitorID], [PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€), [PermitStatus] = โ€œExpiredโ€)) What will this return?? As I understand correctly how MAXROW works based on the Help documentation is that it returns the Keys of the Records of the Permit Table that adheres to the MAXROW Filter??

How do I use that to create a Slice

in the Visitor Table? to run my Report from?

@Aleksi_Alkio

Do you have some more feedback.

The previous Postโ€™s formula โ€œdid not workโ€ as I could not use the Keys to Ref back to the Permit Table to get the [PermitStatus] =MAXROW(Permit, PermitDate, AND([VisitorID] = [_THISROW].[VisitorID], [PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€), [PermitStatus] = โ€œExpiredโ€))

I am stuck and do not know how can I get the [PermitStatus] Value from the Permit Table for that Latest Record Sorted by [PermitDate] into the Virtual Column on the Visitor Table

@Aleksi_Alkio - OK SOLVED

Virtual Column Formula: =ANY(SELECT(Permit[PermitStatus], [PermitID] = MAXROW(Permit, PermitDate, AND([VisitorID] = [_THISROW].[VisitorID], [PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€))),TRUE))

Slice Formula (to run Daily Report from): [VisitorYearPermitStatus] = โ€œExpiredโ€

One way is if you create a virtual column like MAXROW(Permit, PermitDate, AND([VisitorID] = [_THISROW].[VisitorID], [PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€))) then you can read the value with a Deref likeโ€ฆ [LastRowColumnName].[PermitStatus]=โ€œExpiredโ€

@Aleksi_Alkio the Deref is then used in the Slice Condition formula?

Correct

@Aleksi_Alkio ok thanks will try it that way

Iโ€™m assuming the user has the same ID for all his/her records, correct?

@Aleksi_Alkio The VisitorID is the same in the Permit Table and then there is a PermitID that is unique for each Permit Record in the Permit Table. There is a Ref to the Visitor Table using VisitorID

Do you want to trigger the report from the parent or child table?

@Aleksi_Alkio from the Child Table which is the Permit Table. The Slice is built in the Permit Table

I was thinking thisโ€ฆ add a virtual column with the MAXROW expression and search the latest status for that VisitorID and then you can slice the data directly from the Visitor table. Then the slice filter can be like [LAST_STATUS]=โ€œExpiredโ€

@Aleksi_Alkio hmm ok. Sounds like a cleaner solution. Will try that.

@Aleksi_Alkio I tried the formula below in a VC in the Visitor Table but get an error. Thinking with this formula is that I use PermitDate to get the latest Permit for the VisitorID and then Filter it with the SELECT to return the Permit[PermitStatus]

Formula: =MAXROW(Permit, PermitDate, SELECT(Permit[PermitStatus], [VisitorID] = [_THISROW].[VisitorID], AND([PermitIndicator] = โ€œYearโ€, NOT([PermitPaymentMethod] = โ€œResidentโ€))))

Error: Function โ€˜MAXROWโ€™ should have at least two parameters: a table name, a column name, and an optional filter expression

@Aleksi_Alkio a quick elimination test indicates to the fact that MAXROW does not like the SELECT Statement in the 3rd but optional Parameter. Can you suggest a change?

Top Labels in this Space