Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Using LEFT function in SUMMARIZECOLUMNS statement

Hi,   I'm trying to pull the leftmost 10 characters of the Description field, below.  How would I change the below to do so?  I know this should be pretty basic but I've been working on it for some...
  • tamerj1's avatar
    3 years ago

    Hi Anonymous 
    LEFT function will do

    DEFINE
        VAR _items =
            SELECTCOLUMNS (
                SUMMARIZECOLUMNS (
                    Items[ID],
                    Items[Color],
                    Items[Description],
                    FILTER ( Items, Items[Color] = "Green" )
                ),
                --Assign aliases:
                "ID", Items[ID],
                "Color", Items[Color],
                "Description", LEFT ( Items[Description], 10 )
            )
    
    EVALUATE
    _Items