Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

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
Highlighted

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))

Highlighted
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.

Highlighted
Creator
Creator

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.

Highlighted
Partner
Partner

may be like this

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

Highlighted
Champion III
Champion III

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

Highlighted
Creator
Creator

we tried above expression. we are not getting the output