Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rfigueroa
Contributor III
Contributor III

range with set analysis

Hi all, I'm trying to get a distinct count on the records between a range based on the [YearMonth] selected, this is the expression:

Count(DISTINCT {<YearMonth_Rep = {">=$(=min(YearMonth))"}, YearMonth_Rep = {"<=$(=max(YearMonth))"} >} ReportID )

YearMonth_Rep and YearMonth are numeric values in the form 201101, 201102 for january and february 2011 respectively.

If I use the MIN or MAX part only, the filter works as expected, however trying to get both sentences together doesn't work.

How should I change the sentence?

Or do you have another recomendation on how to achieve this?

Thanks in advance

Robert

1 Solution

Accepted Solutions
jsn
Master
Master

Hi,

You'll want to put both conditions within the same {}. You only define the set for YearMonth_Rep at one place, something like:

sum( {$<Year = {“>1978<2004”}>} Sales )


So you should update your expression to:

Count(DISTINCT {<YearMonth_Rep = {">=$(=min(YearMonth))<=$(=max(YearMonth))"} >} ReportID )

View solution in original post

2 Replies
jsn
Master
Master

Hi,

You'll want to put both conditions within the same {}. You only define the set for YearMonth_Rep at one place, something like:

sum( {$<Year = {“>1978<2004”}>} Sales )


So you should update your expression to:

Count(DISTINCT {<YearMonth_Rep = {">=$(=min(YearMonth))<=$(=max(YearMonth))"} >} ReportID )

View solution in original post

rfigueroa
Contributor III
Contributor III
Author

Johannes, it works... thank you!