Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Firstsortedvalue from multi columns

Hi Guys

Here is my purpose:

I want to get the latest data from imported data sheet, for example:

Based on F2='予算', TestedDate='2016-11',Type='売上高実績' these three conditions, and combined with Key(auto number function), I can locate the latest data.

So I write Sum({<Type={'売 上 高 実 績'},Key={"$(=FirstSortedValue({<Type={'売 上 高 実 績'},TestedDate={'2016-11'},F2={'予算'}>} Key, -Key))"}>} Data) in expression.

However, after I applied the expression, the charter display nothing.

I don't know what's wrong with the expression, the Firstsortedvalue statement seems working well.

Someone please help me out, thank you.

1 Solution

Accepted Solutions
techvarun
Specialist II
Specialist II

Hi,

As far as i know FirstSortedValue can hold only 2 parameters.

May be create something like below to get the result.

LOAD *, Type&F2 as FSVKey Resident Table5;

Expression : Sum({<Type={'売 上 高 実 績'},Key={"$(=FirstSortedValue({<FSVKey={'売 上 高 実 績预算'},TestedDate={'2016-11'}>} Key, -Key))"}>} Data)

sample.PNG

View solution in original post

3 Replies
techvarun
Specialist II
Specialist II

Hi,

As far as i know FirstSortedValue can hold only 2 parameters.

May be create something like below to get the result.

LOAD *, Type&F2 as FSVKey Resident Table5;

Expression : Sum({<Type={'売 上 高 実 績'},Key={"$(=FirstSortedValue({<FSVKey={'売 上 高 実 績预算'},TestedDate={'2016-11'}>} Key, -Key))"}>} Data)

sample.PNG

Not applicable
Author

Hi Varun

Your solution can fix this problem, thx a lot!

qliksus
Specialist II
Specialist II

You don't have data for the set analysis filter used . I mean for the date 2016-11 the corresponding value in

F2  = '予算 ' is not available  when you use the below expression it shows data

FirstSortedValue({<Type={'売 上 高 実 績'},TestedDate={'2016-11'},F2={'实际'}>} Key, -Key)