This should sum it up.
So I got several keys with Logged On dates.
The goal is to find the last date and the second last date and see how many days have past.
Tried using a Rank function and that get 1 and 2 but it will not put it on the same line.
So all these lines that are not last date or second last date need to go.
And for every key I need 3 columns. 1 for last date, 1 for 2nd last date and 1 for the number of days between them.
did you use the “rank” function as a screen related graphical function or a pure function (int Rank(measure;[ranking_dims][;Top|Bottom][;(reset_dims)]))?
with the latter, it should be possible to set the base for a solution; then you can nest it with a variable or the like, e.g. like this: [Variable] where([Rank_variable]=2)
Hi @rpinxt
by using more parameters of the rank function (int Rank(measure;[ranking_dims][;Top|Bottom][;(reset_dims)])), maybe it can be solved
when using it, I have noticed that sometimes the Top|Bottom parameter, although indicated optional, must be used for getting it work correctly
Ok thanks @TOJ but could you put it a bit more in context of my example?
I see you start your measure with int.
My webi does not accept this.
Also i have no measure I want to rank a field.
=Rank([Logged On];Top) would be enough??
Items will only roll up when they are measures. You sometimes need to specify an aggregation projection (although max would default to max) so Prev Log as : =Max([Logged On] Where ([LogRank]=2)) may work in your instance.
Hi @rpinxt
I think you can spread out in the 2 rows table the content of the column Prev Log New on all rows by:
max([Prev Log New]) in([Key])
with the default table setting (avoid duplicate rows aggregation = false (unticked)), it would shrink to one row
Well building on that thought I tried implementing the logic of LogRank into the Prev logic like.
Prev Log Var = Max([Logged On]) Where ( Rank([Logged On])=2)
I called it Log Var because to get it showing at alle rows I have to max this logic of @MarkP with what @TOJ said. Don’t think you can do a max on a max.
So first this max.
And then for Prev Log New I max that var again:
=Max([Prev Log Var]) In ([Key])