Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Double stage set analysis on string

Hi,

The title is as it is. I will explain.

I have a double issue with this set analysis.

  • First, the dimension I want at the end of the calculation is a string, not a number. (So I read I should use concat({.....}Dimension,','))

     to be able to use set analysis.

  • Secondly, the set analysis is a 2 stages set analysis

Here is my case: I want the last result of a survey in the past (<Today).

The data is as below:

Location, SurveyResult, DateSurvey

Paris, Poor, 10/01/2015

Tokyo, Verygood, 15/02/2016

Paris, Verygood, 15/07/2015

Tokyo, Perfect, 23/02/2016

Tokyo, Undefined, 07/06/2017

Paris, Undefined, 03/06/2020

I tried something like this but there is only one condition, I miss the condition to say that this DateSurvey should be in the past.

=Concat({<DateSurvey={"$(=(date(Max(DateSurvey))))"}>} SurveyResult,', ')


Thanks for your help. I really tried my best before posting.

1 Solution

Accepted Solutions
Not applicable
Author

I found:

=firstsortedvalue({<DateSurvey={"<=$(=date(today(),'DD/MM/YY'))"}>}SurveyResult,-DateSurvey)

View solution in original post

4 Replies
Not applicable
Author

This is the second part. My goal is to mix them.

=Concat({<DateSurvey={"<=$(=date(today(),'DD/MM/YY'))"}>} SurveyResult,', ')

Not applicable
Author

I found:

=firstsortedvalue({<DateSurvey={"<=$(=date(today(),'DD/MM/YY'))"}>}SurveyResult,-DateSurvey)

alexpanjhc
Specialist
Specialist

If you are looking only the past result. I found that in the 'limited' dataset, the surveyresult should be 'undefined', so you can use that in your set analysis?

Not applicable
Author

Yes indeed thank you. But I would have preferred to know how to merge two set analysis in one (dealing with the same dimension as a filter).