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

FirstSortedValue is not returning single value in set analysis.

Hi,

The FIrstSortedvalue is not working in this expression....If used alone it returns single date but it seems it is return NULL in set analysis..

Sum(Aggr(If(MonthName(Min({1}TxnDate)) = 'May 2013'), Sum({<TxnDate={$(=Date(FirstSortedValue((TxnDate), Aggr(Min({<TxnType={'Invoice'}>}TxnDate),CustomerListID, TxnDate))),'MM/DD/YYYY')}>}Amount), 0), CustomerListID))


Any idea?

Saurabh

4 Replies
Not applicable
Author

What about this expression in textbox?

$(=Date(FirstSortedValue((TxnDate), Aggr(Min({<TxnType={'Invoice'}>}TxnDate),CustomerListID, TxnDate))),'MM/DD/YYYY')


??


regards

Darek

Not applicable
Author

Hi Darek,

BOth expressions  work in textbox but they do not work when i used them in expression....

BTW..is it possible to use the value of textbox in a expression.?

Anonymous
Not applicable
Author

Hi, Ramya.

Try encircling the $() in single quotes:

Sum(Aggr(If(MonthName(Min({1}TxnDate)) = 'May 2013'), Sum({<TxnDate={'$(=Date(FirstSortedValue((TxnDate), Aggr(Min({<TxnType={'Invoice'}>}TxnDate),CustomerListID, TxnDate))),'MM/DD/YYYY')'}>}Amount), 0), CustomerListID))


Hope it helps.

Not applicable
Author

Nope!
It did not work..