Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
vyacheslavg
Contributor III
Contributor III

Simple set analysis (dates)

Hello everyone,

Asking for help with cracking of set analysis.

I need to show number of products, which were created _before_ specific year.

But... below expression works fine and shows correct result.

Count ({$<Product.Year] ={"2017"}>} ProductID)

If I change 2017 to <2017, like this

Count ({$<Product.Year] ={"<2017"}>} ProductID)

it does not work... Shows zero, 0.

Example of data set below.

Product.Year is recognized by Qliksense as date, no problems in other date related calculations.

Bookmarks for selection work as well, but I need set analysis to work to use in more advanced sets.

ProductID Product.Year

1     2013

2     2017

3     2015

4     2017

13 Replies
OmarBenSalem

What's the part not solved yet?

vyacheslavg
Contributor III
Contributor III
Author

I want to work this expression

Count ({$ <[Product.Year] = { "<2017"}>} ProductID)


If  Count ({$ <[Product.Year] = { "2017"}>} ProductID) works for 2017, what is the problem with above (= show all productsId, where years are less than 2017?)


In other words, if 2017 works, why <2017 does not work?

OmarBenSalem

Have no clue.. what I would suggest is creating a year field in the script:

year([Expiry Date]) as myYear;

then use this new field :

Count ({$ <myYear= { "<=2017"}>} ProductID)

that would work

vyacheslavg
Contributor III
Contributor III
Author

thank you so much - this simple approach works perfectly.

It looks like my trouble was related to some issue with autocalendar transformations.

I was going in mad circles trying to understand what is going on...