Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ankit777
Specialist
Specialist

expression

Hi

I have below sample data. I want count entity with date greater than today and show country wise.

   

countryentitydate
count1a3/18/2016
count2b7/18/2016
count1c5/18/2016
count1d9/18/2016
count2e5/18/2016
count2f2/18/2016
count1g5/18/2016
count1h1/18/2016
count2i8/18/2016

Output

count1  3

count2  2

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

You can either do this using a flag created in the script:

Table:

LOAD country,

     entity,

     date,

     If(date >= Today(), 1, 0) as Flag

FROM

[https://community.qlik.com/thread/217313]

(html, codepage is 1252, embedded labels, table is @1);

Expression:

=Count({<Flag = {1}>}entity)

or you can try this expression

=Count({<date = {"$(='>=' & Date(Today()))"}>}entity)

View solution in original post

5 Replies
Not applicable

Hi ,

try like below in expression,

=aggr(count({<date={">$(=date(today(),'MM/dd/yyyy'))"}>}entity),country)

sunny_talwar
MVP
MVP

You can either do this using a flag created in the script:

Table:

LOAD country,

     entity,

     date,

     If(date >= Today(), 1, 0) as Flag

FROM

[https://community.qlik.com/thread/217313]

(html, codepage is 1252, embedded labels, table is @1);

Expression:

=Count({<Flag = {1}>}entity)

or you can try this expression

=Count({<date = {"$(='>=' & Date(Today()))"}>}entity)

Anonymous
Not applicable

use a straight table with Dimension country

and Expression: if (date> today(), Count(Country))

if you need to prepare in script:

NewTable:

load Country,

Count(Country) as counter

resident table

where date > today()

Group by country

Kushal_Chawda
MVP
MVP

Create Straight Table

Dimension:

Country

Expression:

=Count({<entity ={"=Date>today()"}>}entity )

sunny_talwar
MVP
MVP

How are you getting a count of 2 for count2?