Forum Discussion
Anonymous
7 years agoNot applicable
Shortlist only continuous data points in a column
Hello All, I want to create a column which returns the same values of data if they are contnious in nature. For Example:- If there are 9 or more continious datapoints in sequence then, i should ...
- 7 years ago
Anonymous
To do the shortlisting for each key, we can do like this.
I added another key to test. Please see file attached and see the calculated column
Column = VAR BLANKROWDatebefore = MINX ( TOPN ( 1, FILTER ( Table1, [key] = EARLIER ( [key] ) && [date] < EARLIER ( [date] ) && [value] = 0 ), [Date], DESC ), [date] ) VAR BLANKROWDateafter = MINX ( TOPN ( 1, FILTER ( Table1, [key] = EARLIER ( [key] ) && [date] > EARLIER ( [date] ) && [value] = 0 ), [Date], ASC ), [date] ) VAR Date1 = IF ( ISBLANK ( BLANKROWDatebefore ), DATE ( 1900, 1, 1 ), BLANKROWDatebefore ) VAR Date2 = IF ( ISBLANK ( BLANKROWDateafter ), DATE ( 3000, 1, 1 ), BLANKROWDateafter ) RETURN IF ( [value] <> 0 && COUNTROWS ( FILTER ( Table1, [key] = EARLIER ( [key] ) && [date] < Date2 && [date] > Date1 ) ) > 9, [value] )
Zubair_Muhammad
7 years agoCommunity Champion
Anonymous
To do the shortlisting for each key, we can do like this.
I added another key to test. Please see file attached and see the calculated column
Column =
VAR BLANKROWDatebefore =
MINX (
TOPN (
1,
FILTER (
Table1,
[key] = EARLIER ( [key] )
&& [date] < EARLIER ( [date] )
&& [value] = 0
),
[Date], DESC
),
[date]
)
VAR BLANKROWDateafter =
MINX (
TOPN (
1,
FILTER (
Table1,
[key] = EARLIER ( [key] )
&& [date] > EARLIER ( [date] )
&& [value] = 0
),
[Date], ASC
),
[date]
)
VAR Date1 =
IF ( ISBLANK ( BLANKROWDatebefore ), DATE ( 1900, 1, 1 ), BLANKROWDatebefore )
VAR Date2 =
IF ( ISBLANK ( BLANKROWDateafter ), DATE ( 3000, 1, 1 ), BLANKROWDateafter )
RETURN
IF (
[value] <> 0
&& COUNTROWS (
FILTER ( Table1, [key] = EARLIER ( [key] ) && [date] < Date2 && [date] > Date1 )
) > 9,
[value]
)
Anonymous
7 years agoNot applicable
Hi Zubair_Muhammad ,
Superb!! This query works excellently for my dataset..
Thanks for your contnious help :-)