gpt4 book ai didi

powerquery - 如何在forall循环powerapps之前和之后获取记录

转载 作者:行者123 更新时间:2023-12-05 03:25:01 24 4
gpt4 key购买 nike

我正在尝试运行一个返回具有相应日期索引和日期文本的表的函数。这样我就可以在教程屏幕中显示信息。但是,我对如何访问以前的记录感到困惑。这是我的伪代码:

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com