Comparison between current and last month values

Hi everyone!

I’m trying to create a simple KPI view that shows me the count of a certain item on this month compared to the count of the last month.

For now, I have a runningSum that sums or counts (depending of the entity) the values for each months that exists registers (“Projects” example):
runningSum(distinct_count({project_id}), [truncDate("MM", {project_creation}) ASC])

So, for views that I actually have registers for the current and last month (December - November in this case) the KPI works fine, but for my “Projects” view, I don’t have any register for December (my last register is from November) I have the following:
Captura de Tela 2023-12-18 às 21.07.29

On this case I would expect to have the same 58 projects (since I have no new registers for the month of December) giving me 0% of difference compared to November.

What can I do to always have the primary value as the quantity for the current month and the secondary value as the last month, whatever the “entity” (volume, projects, users…)?

Thanks in advance for your attention! :slight_smile:

Hi @leocamara
do you have 0 for December or is there just no entry for December?
BR

Hi @ErikG. I just don’t have any entries for December.

then you have nothing to compare. QS doesnt know there has to be a december value.

Yeah, exactly. But is there a way to “assume” that the last registered value is the current value?

For example, in this case, I can say that in November there were 58 registered projects on the platform. If there were no new records, I continue with the same 58.

Not sure that is possible as you dont have a data row for December.
Will you get a value for each month (Option A) or only changes (Option B)?

grafik

Hello @leocamara !

Was @ErikG 's suggestion helpful, and if so could you mark their comment as a solution to help the community?

It has been some time since we have heard from you but would still like to help you find a solution. If we do not hear from you in the next 3 business days this topic will be archived.