Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Tags (2)
1 Solution

Accepted Solutions

Re: Getting counts of last year,,,

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)

3 Replies

Re: Getting counts of last year,,,

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)

baruchjacob
New Contributor III

Re: Getting counts of last year,,,

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

Re: Getting counts of last year,,,

Thank u sunny,,,,it worked well.

Community Browser