Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
sunny_talwar

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
sunny_talwar

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)

Anonymous
Not applicable
Author

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
Author

Thank u sunny,,,,it worked well.