Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
sarahshong
Contributor III
Contributor III

calculate aggregated percentile for each new day

I need to calculate the percentile distribution for an aggregated data set that finds the 15th percentile of all dates prior that day. For example, in the table below, each product/type would have a 15th% value for date 1/12/2025 that uses all dates prior (1/11/2025,1/10/2025). Each day would bring another day into the percentile dataset. 1/13/2025 would calculate a 15th percentile using 1/10,1/11,1/12.

I've been working with fractile combined with above and aggr but cannot seem to get it to work

 

=fractile(aggr(above(TOTAL Price,0,rowno(TOTAL)),Date,Product,Type),0.15)

 

Product Type Date Price
A 1 1/10/2025 0.225
B 1 1/10/2025 0.2656
C 1 1/10/2025 0.2754
D 1 1/10/2025 0.265
A 2 1/10/2025 0.2698
B 2 1/10/2025 0.2546
C 2 1/10/2025 0.2462
D 2 1/10/2025 0.8642
A 1 1/11/2025 0.4578
B 1 1/11/2025 0.6854
C 1 1/11/2025 0.6892
D 1 1/11/2025 0.6548
A 2 1/11/2025 0.7842
B 2 1/11/2025 0.3654
C 2 1/11/2025 0.1658
D 2 1/11/2025 0.5982
A 1 1/12/2025 0.5643
B 1 1/12/2025 0.6532
C 1 1/12/2025 0.461
D 1 1/12/2025 0.2587
A 2 1/12/2025 0.6541
B 2 1/12/2025 0.3652
C 2 1/12/2025 0.2656
D 2 1/12/2025 0.3578
Labels (2)
2 Replies
Chanty4u
MVP
MVP

Try this 

Fractile(

    AGGR(

        Price, 

        (Date < Max(TOTAL Date)), 

        Product, 

        Type

    ),

   0.15

)

sarahshong
Contributor III
Contributor III
Author

this doesn't seem to work for me. it brings back all nulls.