Power Query Challenge 3: Extracting All Combinations in Power Query - Solving with List.Accumulate

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 7

  • @PowerMquery
    @PowerMquery  3 месяца назад +1

    Link to the challenge file and other solutions for this challenge:
    www.linkedin.com/posts/omid-motamedisedeh-74aba166_excelchallenge-powerquerychllenge-excel-activity-7160402770515128320-JLSU?

  • @Excelambda
    @Excelambda 3 месяца назад +2

    Great video!! Great PQ solution!!
    For combinations without repetitions, (order not important) I always use the uniform distribution of random engine. A big enough random sample will hit all possible occurrences.
    CMB(n,c) : single formula lambda where n: number ; c: number chosen
    =LAMBDA(n,c,UNIQUE(SORT(MAP(SEQUENCE(20*COMBIN(n,c)),LAMBDA(x,TEXTJOIN(",",,SORT(TAKE(SORTBY(SEQUENCE(n),RANDARRAY(n)),c))))))))
    Examples:
    =CMB(5,3)
    1,2,3
    1,2,4
    1,2,5
    1,3,4
    1,3,5
    1,4,5
    2,3,4
    2,3,5
    2,4,5
    3,4,5
    The summing part is simple cosmetics. MAP(.....sum(index(v, textsplit... ✌

    • @PowerMquery
      @PowerMquery  3 месяца назад +1

      I am happy that you like it and thanks for sharing your amazing solutions

  • @hussainmeghani8785
    @hussainmeghani8785 3 месяца назад +1

    Sir, thanks for you video...could you please explain as how I can make possible combinations of 0331*******362...where * can be any number but interger should be fixed..... Appreciated your early response.. Please^3

    • @PowerMquery
      @PowerMquery  3 месяца назад

      You are welcome,
      if you means replace * with any number from 0 to 9, use the following formula.
      =List.Transform( List.Accumulate({0..6}, {""}, (a,b)=>List.TransformMany({0..9}, each a, (x,y)=>Text.From(x)&y)) , each "0331" &_ & "362")

  • @boissierepascal5755
    @boissierepascal5755 3 месяца назад +2

    Too hard to understand for me. ... Totally lost😢

    • @PowerMquery
      @PowerMquery  3 месяца назад

      No worries, initially see the following video then come back and see this one again
      ruclips.net/video/G8PRbWuDcmQ/видео.htmlsi=HDdPvyUg-fJrr1Ev