Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
avastani
Partner - Creator III
Partner - Creator III

Indirect Set Analysis with Expression

Hi,

Is it possible to return a dimension value using the Set Analysis P() notation? In essence, I am looking to find the Account that had the highest sales by Product Category.

My Chart Dimension is Product Category. I have an expression that returns the highest sales contributed by an account. But I need another expression that now tells me who that account is without having to add the Account as a dimension in the chart.

Is it possible?

1 Solution

Accepted Solutions
IAMDV
Luminary Alumni
Luminary Alumni

Have you considered using FirstSortedValue()? You can also use Set Expression using FirstSortedValue()

 

I've made two videos on using FirstSortedValue(). Please check them...

http://qlikshare.com/392

Cheers,

DV

www.QlikShare.com

View solution in original post

6 Replies
qliksus
Specialist II
Specialist II

U can do this through aggr function but if u post some sample application i will do that in set analysis

max(aggr (   max( aggr( max(sales) , productCategory)) , productCategory,account))

avastani
Partner - Creator III
Partner - Creator III
Author

I tried the above, but that didn't work. I will try to upload a sample app.

IAMDV
Luminary Alumni
Luminary Alumni

Have you considered using FirstSortedValue()? You can also use Set Expression using FirstSortedValue()

 

I've made two videos on using FirstSortedValue(). Please check them...

http://qlikshare.com/392

Cheers,

DV

www.QlikShare.com

sebastiandperei
Specialist
Specialist

Hi,

You can use:

=fieldValue('Account', fieldIndex('Sales',max(Sales)))

avastani
Partner - Creator III
Partner - Creator III
Author

FieldIndex works but for simple expressions. It falls apart when we have a complex expression with multiple parts to it.

FirstSortedValue does work but with limitations. Have to get workarounds to ignore certain things.. So in summary, both are good solutions. Thanks all.

IAMDV
Luminary Alumni
Luminary Alumni

I agree with you FieldValue & FieldIndex works but if you wanted to play with Sets then you need FirstSortedValue(). Which is very powerful and you can be very clever with it.

Cheers,

DV

www.QlikShare.com