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

Count Ids for Max Month

Team,

I have a simple problem and can't seem to work it out.  I have a table that has [CW ID] and a month value.  The data is updated once at the beginning of the month with the previous month's data which means that from March 1 until April 1 the table will only contain data up to and including Feb and on April 1 the March data comes in.

I am trying to do a count of [CW ID] but only for the mac month in the data and can't seem to get the code working.

Suggestions?

Examples? 

1 Solution

Accepted Solutions
brf10043
Creator
Creator
Author

Thanks Sunny,

When I try to use this code as my expression the chart displays a "No data to display" error.

Count({<CW_Month = {"$(=Max(CW_Month))"}>}[CW ID])

View solution in original post

5 Replies
sunny_talwar

May be this:

Count({<Month = {"$(=Max(Month))"}>}[CW ID])

brf10043
Creator
Creator
Author

Thanks Sunny,

When I try to use this code as my expression the chart displays a "No data to display" error.

Count({<CW_Month = {"$(=Max(CW_Month))"}>}[CW ID])

sunny_talwar

How is CW_Month created in the script? What do you see when you use Max(CW_Month) in a KPI Object?

brf10043
Creator
Creator
Author

Thanks Sunny!  I worked it out.  I wasn't using the correct date column and I need to count Distinct records!

Count({<CW_Date = {"$(=Max(CW_Date))"}>}Distinct [CW ID])

sunny_talwar

Great