Forum Discussion

govi's avatar
govi
Helper II
5 years ago
Solved

Measure to find first & second instance

Hi, I have a problem. I have a table with four columns: DataTime | userId | Question | Answer   The question "What is your weight?" is asked (and answered) about 7 times per userId.   I have t...
  • HotChilli's avatar
    HotChilli
    5 years ago

    The ranking should take into account  user and the question so a column would look like this:

    RankCol = 
    VAR _user = TableQ[userId]
    VAR _question = TableQ[question]
    RETURN
        RANKX( FILTER (TableQ,  TableQ[userId] = _user && TableQ[question] = _question ),
         TableQ[DateTime],, ASC, Dense)

     

    swap in your table name.