Forum Discussion
Inherit Values from previous rows
- 2 years ago
"Subkategory 4" on the screenshot below sounds like the case you described, but it shows the expected values.
Can you share a sequence where it breaks?
Best Regards,
Alexander
Hi BenediktW,
If "MSCOP" can appear only once, you can try such a calculated column:
In plain text:
Result =
VAR CurrentSubcategory = [Subcategory column]
VAR CurrentIndex = [Index.1]
VAR InitialValue = MINX ( FILTER ( MyTable, [Subcategory column] = CurrentSubcategory ), [First Row value] )
VAR FinalValue = ABS ( COUNTROWS ( FILTER ( MyTable, [Subcategory column] = CurrentSubcategory && [Index.1] >= CurrentIndex && [Inherit_Flag] = "MSCOP" ) ) - InitialValue )
RETURN FinalValue
Best Regards,
Alexander
Hi,
thank you very much already! That is working better than my approaches so far. Unfortunately, it can happen that the "MSCOP" Identifikator shows up multiple times per Subkategory.
- barritown2 years agoSolution Sage
Okay, try this modification then:
Result = VAR CurrentSubcategory = [Subcategory column] VAR CurrentIndex = [Index.1] VAR InitialValue = MINX ( FILTER ( MyTable, [Subcategory column] = CurrentSubcategory ), [First Row value] ) VAR FinalValue = ABS ( MOD ( COUNTROWS ( FILTER ( MyTable, [Subcategory column] = CurrentSubcategory && [Index.1] >= CurrentIndex && [Inherit_Flag] = "MSCOP" ) ), 2 ) - InitialValue ) RETURN FinalValueBest Regards,
Alexander
- BenediktW2 years agoAdvocate I
Works well, but when the first row value is 1 and there is an "MSCOP" Identificator. The following rows after that are staying one.
- barritown2 years agoSolution Sage
"Subkategory 4" on the screenshot below sounds like the case you described, but it shows the expected values.
Can you share a sequence where it breaks?
Best Regards,
Alexander