Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Add if condition for Firstsorted value count.

Ex : if(M_NO=FirstsortedValue(M_NO),-Aggr(avg(T_Time),M_NO,P_ID),Count(B_ID))

In an table we are calculated the min of avg against the M_NO and P_ID.

i tried by above expression by count against the M_NO and Min of avg .

6 Replies
sunny_talwar

May be this

Sum(Aggr(If(M_NO = FirstsortedValue(TOTAL <B_ID> M_NO, -Aggr(Avg(T_Time), M_NO, P_ID), 1, 0), M_NO, B_ID))

vishsaggi
Champion III
Champion III

Are you getting an error like nested aggr not allowed. May be try like

= Count(Aggr( if(M_NO=FirstsortedValue(M_NO, -Aggr(avg(T_Time),M_NO,P_ID), B_ID), M_NO))


Change accordingly.

Anonymous
Not applicable
Author

We are not getting the count for above expression.

Dimension is P_ID.

We want Count of b_id against the min of avg of M_ID,P_ID.

raman_rastogi
Partner - Creator III
Partner - Creator III

may be like this

=Aggr( if(M_NO=FirstsortedValue(M_NO),-avg(T_Time),Count(B_ID)),M_NO,P_ID)

vishsaggi
Champion III
Champion III

can you share a sample to look into? And your expected output.

Anonymous
Not applicable
Author

we tried above expression. we are not getting the output