Can anyone clarify this: Most of my trouble ...

Can anyone clarify this:

Most of my trouble comes from trying to figure out the proper reference format from where ever Im trying to call it.

Payment History[Date] [Payment History][Date] [Payment History].[Date] [Payment History[Date]]

These are all valid formats depending on where you are and what your trying to doโ€ฆ but, how do i know which format to use?

CURRENT ISSUE

I have a table Students with a Reference to the Payments table called โ€œPayment Historyโ€.

Iโ€™m trying to find all students that have NOT paid this monthโ€ฆ Im using the following query and I just cant seem to get the reference correct.

SELECT(

Students[Name],

AND(

Year(Payment History[Date])<>Year(Today()),

Month(Payment History[Date])<>Month(Today())

) )

This query will go into the Email Template.

anyway, sorry for the double post hereโ€ฆ

Thanks for all the help so far everyoneโ€ฆ

0 5 343
5 REPLIES 5

COUNT(SELECT(Students[Name], AND( Year([Date])=Year(Today()), Month([Date])=Month(Today()) ))=0

is the basic but then the payment needs to be in the same table. IF the payment is in another table, you should read the status likeโ€ฆ

COUNT(SELECT(Payment History[KeyColumn], AND( YEAR([Date])=YEAR(TODAY()), MONTH([Date])=MONTH(TODAY()), [NAME]=[_THISROW].[NAME]) ))=0

@Aleksi_Alkio That did the trickโ€ฆ used this Expression in a slice on Students and got exactly what I wanted.

COUNT(

SELECT(

[Payment History][Name],

AND(

YEAR([Date])=YEAR(TODAY()),

MONTH([Date])=MONTH(TODAY()),

[NAME]=[_THISROW].[NAME]

)

) )=0

Again, it came down to trial and error on the format of

[Payment History][Name] vs Payment History[Name]

Thanks a ton my friend.

@David_Hopkins Soโ€ฆ I need this same result for use in the Phone Field of an SMS Workflow task.

I was using your methodology, for building the expressions, and for the most part itโ€™s workingโ€ฆ but I cant seem to get it to work on this oneโ€ฆ

Im working in WF against the Reminders Table. (key, Ttitle, Message, Valediction, Last Sent) โ€ฆ standard for sending an SMS on update of the Last Sent field.

I need the cell numbers to come from Active Students slice where Payment History returns count=0 for Month(Today)โ€ฆ

Something like thisโ€ฆ

SELECT(Active Students[Cell],

COUNT(

[Payment History][Name],

AND(

YEAR([Date])=YEAR(TODAY()),

MONTH([Date])=MONTH(TODAY()),

[NAME]=[_THISROW].[NAME]

)

)=0 )

Butโ€ฆ that throws a great looking errorโ€ฆ

โ€ฆ contains an invalid expression โ€˜Unable to find column โ€˜Payment Historyโ€™, did you mean โ€˜Payment Historyโ€™?โ€™

(why, yesโ€ฆ

Yes I did mean Payment Historyโ€ฆ )

Okโ€ฆ I donโ€™t know where my head is at some daysโ€ฆ but I walked away for a few minsโ€ฆ While I was clearing my head i realized that I have a Slice called โ€œMissing Payments This Monthโ€. So, I just set my WF to:

SELECT(Missing Payments This Month[Cell], [Status]=โ€œActiveโ€)

Yeahโ€ฆ sometimes itโ€™s good to go away from the box so you can see it again from another directionโ˜บ

Top Labels in this Space