Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filtering an expression using MonthName

Hi, I've got a table like this where I've loaded four of the rows from my data source but included a field in the load statement called 'Month Name' which is monthName(Transaction_Date) as 'MonthName'.

Customer_IDCustomer_NameTransaction_DateMonthNameFlag
1234Mr X01/01/2016Jan 2016N
5678Mrs Y01/03/2016Mar 2016Y
1435Mr Z12/03/2016Mar 2016N

I'm trying to create a little KPI table where I'd like to do a count of customer IDs in a particular month. COUNT(DISTINCT{<MonthName="Mar 2016">}Customer_ID)

I didn't want to apply a filter pane in this sheet as I need to call upon data from other past months in the same sheet. I'm trying to apply some filters in the expressions instead. My answer keeps defaulting to zero however. If I remove "Mar 2016" I get a number, e.g. 4,012. Is something funny going on with my datestamp converting it to a number and how might I get around it?

Many thanks,

Sarah

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Count(DISTINCT{<MonthName = {"Mar 2016"}>}Customer_ID)

If this doesn't work, would you be able to share the script which you used to create the MonthName field?

View solution in original post

2 Replies
sunny_talwar

Try this:

Count(DISTINCT{<MonthName = {"Mar 2016"}>}Customer_ID)

If this doesn't work, would you be able to share the script which you used to create the MonthName field?

Anonymous
Not applicable
Author

Thanks Sunny, that worked perfectly!

Thanks again,

Sarah