Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis Greater Than Date Field

Hey All,

I know this is a very frequent question that has been asked and I have tried nearly every possibility in the book from my searched solutions however I cannot see to get this set analysis working, could someone please assist me. I am trying to pull the count of products that have been graded from a specific date in time to date (Current Date - 13 Months). Iv tried providing all components of my setup below and assistance would be greatly appreciated please guys.

1. Primary Field Im trying to filter on is defined as:

- Date(A.YMDateField, 'YYYYMM') as A.YMDateField

2. Variable is Defined as and which returns (201806)

- vRollingPeriod = Date(AddMonths(Now(), -2), 'YYYYMM')


3. Set Analysis is Defined as:


- COUNT(DISTINCT {<A.YMDateField={">=$(vRollingPeriod )"}>}OH.Product)

4. Sample Of Data:

201805

201805

201806

201806

201807

I should thus be getting a value of 2 back for the counting of distinct products from today back to 201806, however the value being returned is 0.

Thanks in advance.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Finally got this resolved   The conversion to YYYYMM was holding the days portion and thus not giving us a direct value that we needed. With the help from a college we had to change the variable used in the greater than part to the following:

=num(AddMonths(DATE#(YEAR(Today()) & num(month(Today()),'00'), 'YYYYMM'), -2))

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Finally got this resolved   The conversion to YYYYMM was holding the days portion and thus not giving us a direct value that we needed. With the help from a college we had to change the variable used in the greater than part to the following:

=num(AddMonths(DATE#(YEAR(Today()) & num(month(Today()),'00'), 'YYYYMM'), -2))