Forum Discussion
Measure to find first & second instance
- 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.
Hi VGRG and amitchandak ,
Thanks for you help!
This is an example of the data (as picture and as csv, I cannot attach a txt or xls file):
DateTime;userId;question;answer;
27-11-20 10:41;161694;Are you male or female?;Male;
27-11-20 10:41;161694;What is your age?;39;
27-11-20 10:41;161694;What's your height?;190;
27-11-20 10:41;161694;What's your weight?;120;first
27-11-20 20:06;161696;Are you male or female?;Male;
27-11-20 20:06;161696;What is your age?;51;
27-11-20 20:06;161696;What's your height?;183;
27-11-20 20:06;161696;What's your weight?;92;
01-12-20 20:11;161696;What's your weight?;92;
02-12-20 19:51;161694;What's your weight?;115;second
04-12-20 19:27;163513;Are you male or female?;Male;
04-12-20 19:27;163513;What is your age?;47;
04-12-20 19:27;163513;What's your height?;170;
04-12-20 19:27;163513;What's your weight?;88;
04-12-20 19:34;163513;What's your weight?;92;
07-12-20 20:12;161696;What's your weight?;94;
08-12-20 19:57;161694;What's your weight?;117;third
11-12-20 20:21;163513;What's your weight?;87;
etc;etc;etc;etc;
I need a measure to isolate the first and an measure to isolate the second weight(answer) per user.
When I have them isolated I can use them for a calculation I need to perform.
Can you help?
Thanks a lot!
govi
- HotChilli5 years agoCommunity Champion
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.