Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Value for a max ID of a Dimension at UI level

IHi All,

Good Day !

I have data of following structure:

  

IDDIMENSION-AVALUE
1A100
2B101
3A102
4A103
5A104
6A105
7A106
8B107
9B108
10B109
11A110
12A111
13A112
14A113
15A114
16A115
17A116
18A117
19A118
20B119
21B120
22B121
23B122
24B123
25B124

What I am trying to do is to get VALUE of maximum ID for a particular dimension. I have achieved this functionality at scripting level, but still trying to achieve at front end scripting.

Output I want is:

  

IDDIMENSION-AVALUE

  

19A118

  

25B124

Please help me out to meet this requirement at front end scripting, as user experience needs to be associative.

Attaching Excel file and qvw file:

5 Replies
sunny_talwar

This?

Capture.PNG

Gysbert_Wassenaar

Use DIMENSION-A as chart dimension and as expressions Max(ID) and FirstSortedValue(VALUE, -ID).


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Sunny, Gysbert. That worked very well. I was trying to do it with set analysis, but did not succeed.

sunny_talwar

Using set analysis:

Capture.PNG

Gysbert_Wassenaar

If you want to learn how to achieve the same result with set analysis then that's a fine exercise. But the FirstSortedValue function was created exactly for cases like this. Don't make things more complicated then necessary.


talk is cheap, supply exceeds demand