-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculated difference #403
Comments
Yeah, I see there's a |
How does this look:
It is overloading the Another alternative is to have a separate function for when you want the subtotal to include substractions, like:
|
A new method would be cleaner, I believe. Following from your example I imagine usage such as: var = var.add_subtotal(name="Promoters", categories=[9, 10], anchor="bottom")
var = var.add_subtotal(name="Detractors", categories=[1, 2, 3, 4, 5, 6], anchor="bottom")
var = var.add_subtotal_difference(name="NPS", add=["Promoters"], subtract=["Detractors"], anchor="bottom") Any reason why the |
@jjdelc is it possible to add a difference calculation without creating/showing its dependent subtotals? For example would it be possible to add an NPS without adding Promoter and Detractor subtotals? Perhaps I misunderstood your original example and "Female"/"Male" were category names rather than subtotal names? If so, would this kind of usage be viable? var = var.add_subtotal_difference(name="NPS", add=[9, 10], subtract=[1, 2, 3, 4, 5, 6], anchor="bottom") |
Yes, the subtotal does not need to show the previous ones. but you have to indicate the items:
In my example, I was abusing the fact that you can indicate either category IDs or category names. |
Ok great - this is preferable to my original assumption about naming subtotals anyway. |
@jjdelc are you able to add support for Calculated differences?
https://crunch.io/dev/features/subtotal-differences/
The text was updated successfully, but these errors were encountered: