Announcements
cancel
Showing results for
Did you mean:
Contributor II

## Calculate Previous Month Record Count

We have a calculation in an app that Gets count of records from previous month.
All individual variables seem to be working.
however, the calculation returns zero.

Calc=  count({\$<RecordCurrent_Month = {"Previous_Month_End"}>}Month_end_note_id)

WHERE

RecordCurrent_Month = date(DATA_DATE,'MM/YY')

Labels (2)

• ### SaaS

1 Solution

Accepted Solutions
Contributor III

I am sharing a .qvf file showing how I would solve this using The As Of Table.

All you need to know about that is described on this post: The As Of Table . I don't think I can explain better than Hic.

I hope it solve your needs.

9 Replies
Specialist

This set analysis is going row wise, so there is no data where current_month=previous_month in backend in the same row,
try this
Calc=  count({\$<RecordCurrent_Month = {"=\$(=date(addmonths(DATA_DATE,-1),'MM/YY') )"}>}Month_end_note_id) it should

work when data can be in tabular format like in charts and table.

Contributor II
Author

Gabbar,

Thanks for reaching out.

i had to replace data_date but otherwise i copied the above. I verified that the addmonths calc works too.

The above returns zero still. I am using a pivot table, not sure if that plays a factor.

Thank you,

Alec

Specialist

Try this:

Contributor II
Author

No luck. date(addmonths(RecordCurrent_Month,-1),'MM/YY') is valid however.

Results in the screen shot, even included the previous month calculation

Specialist

Please share a sample dataset for the same.

Contributor II
Author

Sure, here is an xlsx of the non-sensitive data involved.

This should be enough  @Gabbar

Specialist

Will update the solution as soon as i am able to find, till then
try this:
Above('Your Normal Set expression of current month')
Sort your data in ascending order according to recordcurrent_month

Contributor III

I am sharing a .qvf file showing how I would solve this using The As Of Table.

All you need to know about that is described on this post: The As Of Table . I don't think I can explain better than Hic.

I hope it solve your needs.