我正在尝试运行一个函数,该函数返回具有相应日期索引和日期文本的表。这样我就可以在教程屏幕上显示信息了。但是,我对如何访问以前的记录感到困惑。这是我的伪码:
ForAll( Tweets (sorted by crf1d_date_index),
If(the record IS NOT the LAST record,
If('crf1d_date_index' != 'crf1d_date_index' of the NEXT record,
{
Step: crf1d_date_index,
Text: crf1d_tweet_time
}
)
)
If(the record IS the LAST record,
If('crf1d_date_index' != 'crf1d_date_index' of the PREVIOUS record),
{
Step: crf1d_date_index,
Text: crf1d_tweet_time
}
)
)发布于 2022-05-08 17:16:15
您可以使用序列函数创建索引列表,然后在ForAll中使用该列表访问tweet列表,如下所示:
With(
{ myTweets, Tweets(sorted by crf1d_date_index) },
ForAll(
Sequence(CountRows(myTweets)),
With(
{
tweet: Index(myTweets, Value),
previousTweet: If(Value > 1, Index(myTweets, Value - 1)),
nextTweet: If(Value < CountRows(myTweets), Index(myTweets, Value + 1))
},
If(
Value < CountRows(myTweets),
If(
tweet.'crf1d_date_index' != nextTweet.'crf1d_date_index',
{ Step: crf1d_date_index, Text: crf1d_tweet_time }
),
If(
tweet.'crf1d_date_index' != previousTweet.'crf1d_date_index',
{ Step: crf1d_date_index, Text: crf1d_tweet_time }
)
)
)
)
)发布于 2022-05-12 07:42:17
Set(distinctTweets, AddColumns(
GroupBy(Tweets, "crf1d_date_index", "Dates"),
"tweet_time",
First(Dates).tweet_time));
With({myTweets:SortByColumns(distinctTweets,"crf1d_date_index")},
ForAll(Sequence(CountRows(myTweets)),
With({tweet:Index(myTweets,Value)},
If(true,
{
Step:Value-1,
Text: tweet.tweet_time,
Image: SampleImage
}, Blank()
)
)
)
)https://stackoverflow.com/questions/72145051
复制相似问题