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

Script check!

if(Release='2015'

or Release='2016'

or Release='2014'

and ( Release <> '2017' and Release <> '2018') , count(distinct(Product_Name)))

I want count number of products that have releases before 2017 but does not have releases after 2017

What is wrong with my script here? I won't work. please help.

1 Solution

Accepted Solutions
Not applicable
Author

Hello David,

How about this (I assume you want to use this as a chart expression):

count({$<Release={">=2014<2017"}>} DISTINCT Product_Name)

BR,

Kuba

View solution in original post

5 Replies
Not applicable
Author

load count Distinc Product_Name as Qtd

from ... where

Release='2015'

or Release='2016'

or Release='2014'

and ( Release <> '2017' and Release <> '2018')

Not applicable
Author

Hello David,

How about this (I assume you want to use this as a chart expression):

count({$<Release={">=2014<2017"}>} DISTINCT Product_Name)

BR,

Kuba

swuehl
MVP
MVP

Maybe like

Exclude:

LOAD Product as ProductToExclude

FROM YourtableSource

WHERE Release >=2017;

Result:

LOAD Count(DISTINCT Product) as ProductCount

FROM YourTableSource

WHERE NOT EXISTS( ProductToExclude, Product)

AND Release < 2017;

DROP TABLE Exclude;

Not applicable
Author

yes I want to do it in chart expression. but in my real data there are releases that are named with character not just with numbers. can I specifically name them? not using range of number of years?

Not applicable
Author

This will count all product_name, but only from 2017:

count({$<Release={'2017'}>} DISTINCT Product_Name)  


This for example will count all, without those released in 2017 & 2018

count({$<Release={*}-{'2017','2018'}>} DISTINCT Product_Name)  

Check below to get more info:

Set Analysis - Part 2 - Cool Stuff You Can Do (video)