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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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
MVP
MVP

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
MVP
MVP

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.