Forum Discussion

clint_powell's avatar
clint_powell
Frequent Visitor
2 years ago
Solved

Error when using Distinct Function: A table of multiple values was supplied where a single value was

New user here trying to navigate unexpected results. I have a fact table that has multiple entries for repeating data points (email addresses). The same email address is listed multiple times within the same column.

 

I am trying to create a new column in a new table using the DISTINCT function, but I am recieving the error mentioned above. 

 

The goal is to populate the new column in the new table with ONLY a list of the unique email addresses that are present in the fact table. 

 

It was my assumption that DISTINCT was a fairly straightforward solution, but that does not appear to be the case. Any tips?

  • Dangar332's avatar
    Dangar332
    2 years ago

    Hi, clint_powell 

     

    Syntax error for all() function

     

    See my code properly

    You miss  ) to finish all() function

     

    filter(

      all(tablename[columnname]),

     tablename[columnname]<>blank()

    )

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.and don't forgot to give kudos.

6 Replies

  • Dangar332's avatar
    Dangar332
    Resident Rockstar

    hi, clint_powell 

    use all() function it give unique value of column

    like below

    all(tablename[columnname])

    • clint_powell's avatar
      clint_powell
      Frequent Visitor

      Thanks! Is there a way to pull in all the values, but ignore the nulls?

      • Dangar332's avatar
        Dangar332
        Resident Rockstar

        hi, clint_powell 

        try below

        filter(
          all(tablename[columnname]),
         tablename[columnname]<>blank()
        )

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.and don't forgot to give kudos.

  • clint_powell's avatar
    clint_powell
    Frequent Visitor

    Thanks so much for the quick responses! But, I'm still getting an error, see below:

     

    • Dangar332's avatar
      Dangar332
      Resident Rockstar

      Hi, clint_powell 

       

      Syntax error for all() function

       

      See my code properly

      You miss  ) to finish all() function

       

      filter(

        all(tablename[columnname]),

       tablename[columnname]<>blank()

      )

       

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.and don't forgot to give kudos.