首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在所有循环电源应用程序中获取前后记录

如何在所有循环电源应用程序中获取前后记录
EN

Stack Overflow用户
提问于 2022-05-06 16:59:16
回答 2查看 612关注 0票数 3

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

代码语言:javascript
复制
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 
                     }
               )

)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-05-08 17:16:15

您可以使用序列函数创建索引列表,然后在ForAll中使用该列表访问tweet列表,如下所示:

代码语言:javascript
复制
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 }
        )
      )
    )
  )
)
票数 3
EN

Stack Overflow用户

发布于 2022-05-12 07:42:17

代码语言:javascript
复制
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()
            )
        )
    )
)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72145051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档