Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting counts of last year,,,

Hello all,,,

I'm unable to get the count value(invitation_id) of the last year's invitation.

Script:

Load `invitation_id`,

`date_created`;

SQL SELECT

`date_created`,

      `invitation_id`

      FROM invitation;

Expression:

count({$<date_created={$(=Year(date_created) - 1)}>}invitation_id)

Thanks in advance

1 Solution

Accepted Solutions

Try like this:

Load `invitation_id`,

`date_created`,

Year(date_created) as Year_Created;

SQL SELECT

`date_created`,

      `invitation_id`

      FROM invitation;

Expression:

count({$<Year_Created={$(=Max(Year_Created) - 1)}>}invitation_id)

View solution in original post

3 Replies

Try like this:

Load `invitation_id`,

`date_created`,

Year(date_created) as Year_Created;

SQL SELECT

`date_created`,

      `invitation_id`

      FROM invitation;

Expression:

count({$<Year_Created={$(=Max(Year_Created) - 1)}>}invitation_id)

View solution in original post

Contributor III
Contributor III

try something like the example below, maybe you'll need to play with variable assignment in the set analysis.

LET vLastYear = year(today()) -1;

count({$<date_created={'$(vLastYear)'}>}invitation_id)

Not applicable

Thank u sunny,,,,it worked well.