Changing total of lines in the dataset after the flter

Hello,

I have a dataset with each row assigned to a client (1,2,3).

I would like to create a calculated parameters that count the number of rows present in the dataset.

However I would like that this values changes if I decide for example to filter out the client 3 then it has to consider onlt the total of client 1 and 2…
I would then use this value in another calculation that also has to change since the value itself changed…

thank you

Hi @remba87,

You can use the countOver() function to create these type of calculated fields.

As an example I created the following calculated field, FilteredRowCount using the following formula:
countOver({Client ID}, [], PRE_AGG)

Then I built an analysis with a filter, selecting Client IDs 2 & 3 only:
image

and then changing the filter to Client ID 3 only:

You can then use the FilteredRowCount calculated field in another calculated field, taking note of the limitations that apply to Level-aware calculations, as documented here.

Let me know if this provides a solution, if so please mark my reply as “Solution” to help the community.

Many Thanks,
Andrew

1 Like

Hi @abacon,

yes it worked…I was using count only or countover but selecting a field to aggregate…probably this was the error,

thank you!