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: 
scotthan
Partner - Contributor III
Partner - Contributor III

FirstSortedValue() and Set Analysis

I can't seem to get the result of my FirstSortedValue function to work in Set Analysis.

If I have a variable:

vTestDeal = FirstSortedValue(KeyDeal, Proceeds)

...which yields 10 and a set analysis expression:

Sum({$<KeyDeal = {$(vTestDeal)} Measure)

then you would think that I would get the Sum of the Measure where KeyDeal = 10.  However, the chart doesn't calculate and I get a "No data to display" error.

If I replace $(vTestDeal) in the set analysis with the number 10, my data comes up correctly.  This made me think it might be a datatype issue or something, but experimenting with num and text functions and using single quotes didn't solve my issue.

Anyone have any ideas?!

Thanks,

Scott

1 Solution

Accepted Solutions
Not applicable

Scott can you try with:

Sum({$<KeyDeal = {"$(vTestDeal)"} Measure)

Regards,

Kiran.

View solution in original post

4 Replies
Not applicable

Scott can you try with:

Sum({$<KeyDeal = {"$(vTestDeal)"} Measure)

Regards,

Kiran.

SunilChauhan
Champion II
Champion II

use beelow code

Sum({$<KeyDeal = {"$(vTestDeal)"} <}Measure)

Sunil Chauhan
Not applicable

as KeyDeal returns numeric value then to compare it with vTestDeal you have to convert it into numeric:

Sum({$<KeyDeal = {$num#(vTestDeal)} Measure)

try it.

regards

scotthan
Partner - Contributor III
Partner - Contributor III
Author

Thanks everyone, I was able to wrap my variable in a num function and use the doubel quotes to get my answer.