作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试运行一个返回具有相应日期索引和日期文本的表的函数。这样我就可以在教程屏幕中显示信息。但是,我对如何访问以前的记录感到困惑。这是我的伪代码:
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
}
)
)
最佳答案
您可以使用 Sequence function创建一个索引列表,然后在 ForAll 中使用该列表来访问您的推文列表,类似于以下表达式:
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 }
)
)
)
)
)
关于powerquery - 如何在forall循环powerapps之前和之后获取记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72145051/
我是一名优秀的程序员,十分优秀!