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: 
nachiket_shinde
Contributor III
Contributor III

How to get Sorted value?

Hi Experts,

I have following data

   

TypeMonth_numberMonthYearRateAvgRollingSum
ARP112015018.55538.55538.5553
ARP212015018.56268.5589517.1179
ARP312015018.55238.55673333325.6702
ARP412015018.58238.56312534.2525
ARP512015018.59138.5687642.8438
ARP612015018.59128.572551.435
ARP712015018.59128.57517142960.0262
ARP812015018.59128.57717568.6174
ARP912015018.59188.578877.2092
ARP1012015018.59148.58006

85.8006

I want Type wise, Max(Month_Number) wise, year wise avg. In this case 8.58006.

What expression should I write for this?

1 Solution

Accepted Solutions
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

First row.PNG

Ue below exp :

Rate:  Sum({<Month_number={'$(=min(Month_number))'}>}Rate)

Avg:    Sum({<Month_number={'$(=min(Month_number))'}>}Avg)

Rooling sum :  Sum({<Month_number={'$(=min(Month_number))'}>}RollingSum)

I hope this mat helps you.

-Nagarjun

View solution in original post

7 Replies
sunny_talwar

Where are you looking to get this, text box object or chart? If it is a chart what all are going to you dimensions?

nachiket_shinde
Contributor III
Contributor III
Author

Want to display in Bar chart Type wise, Max(Month_Number) wise, year wise

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

First row.PNG

Ue below exp :

Rate:  Sum({<Month_number={'$(=min(Month_number))'}>}Rate)

Avg:    Sum({<Month_number={'$(=min(Month_number))'}>}Avg)

Rooling sum :  Sum({<Month_number={'$(=min(Month_number))'}>}RollingSum)

I hope this mat helps you.

-Nagarjun

shraddha_g
Partner - Master III
Partner - Master III

which chart you are using? what is expected output for this

rajpreeths
Creator
Creator

Hi nachiket.shinde.1981


You can use  expression FirstSortedValue(Avg,-aggr(Avg,Year,Month_number)) for the expected results.


Please refer the attachment and if the result is not as requested then please share dimensions details to be used in the chart.


Rajpreeth S

rajpreeths
Creator
Creator

Hi ,


I forgot to mention one point,

Type should be added in the aggr expression if you have multiple values for Type field in data model. ( For type wise data)

FirstSortedValue(Avg,-aggr(Avg,Type,Year,Month_number))

Rajpreeth S

sampada0810
Creator
Creator

Use a straight table and apply sorting