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: 
anuradhaa
Partner - Creator II
Partner - Creator II

Counts based on Date

I want to get count when data is there,

So i use below expression

if(len(Date)<0,Count(Date)).

But it doesn't give any value.

if i use only count(Date) it return values. what was my issue

1 Solution

Accepted Solutions
sunny_talwar

May be this using set analysis:

Count({<Date = {'*'}>} Date)

View solution in original post

6 Replies
Anonymous
Not applicable

Maybe try something like this :

     Count( if ( len(Date)>0 , 1 , 0 )

sunny_talwar

May be this using set analysis:

Count({<Date = {'*'}>} Date)

avinashelite

Try like this

if(len(trim(Date))>0,Count(Date))



tresesco
MVP
MVP

You probably meant, Sum( if ( len(Date)>0 , 1 , 0 ). Otherwise, counting '0' (when the condition fails) also increases the count.

Anonymous
Not applicable

may be something like this?

=Count(if(len(trim(Date))>0,Date))


You can use Disticnt, if required?

jagan
Partner - Champion III
Partner - Champion III

Hi,

You can simply use


Count({<Date = {'*'}>} Date)

* ignores Null & Empty values.

If you want to deal this in script then try like below

LOAD

*,

If(Len(Trim(Date)) >0, 1, 0) AS DateCount

FROM DataSource;

Now in Front end just use

Sum(DateCount)

Hope this helps you.

Regards,

Jagan.