Qlik Community

Qlik Sense Cloud Discussions

Highlighted
Partner
Partner

Trouble counting Yearly Records (YTD, previous YTD)

This will likely be so simple. I've been staring at it and feel I've simply gone blind so wanted to ask for help.

I'm trying to create KPI's in a Qlik Sense Cloud app for the following:

Total Records (All Years):  Easy/Complete...

=Count([Case Number[)


Current Year's YTD Records: NOT WORKING...

=Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today()))"}>}[Case Number])


Last Year's YTD Records: NOT WORKING...

=Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today())-1)"}>}[Case Number])

The attached screenshot is just for reference and helped me validate values for each variable.  It also shows what each year should have for totals.

Hoping someone can guide me on what I'm doing wrong.  As said, this should be so simple but I probably just need to take a break and come back later.

Thanks!

1 Solution

Accepted Solutions
Partner
Partner

Re: Trouble counting Yearly Records (YTD, previous YTD)

Sorry for the false start but will leave this up to help others.

I figured it out...

Current Year's YTD Records: NOT WORKING...

WRONG -> Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today()))"}>}[Case Number])

CORRECT -> (Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today()))'}>} [Case Number]))

Last Year's YTD Records: NOT WORKING...

WRONG -> Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today())-1)"}>}[Case Number])

CORRECT -> =(Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today())-1)'}>} [Case Number]))

' and " got confused along with parenthesis placement.  Thanks to all since it's all the previous advice I've saved that helped me see the error.

1 Reply
Partner
Partner

Re: Trouble counting Yearly Records (YTD, previous YTD)

Sorry for the false start but will leave this up to help others.

I figured it out...

Current Year's YTD Records: NOT WORKING...

WRONG -> Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today()))"}>}[Case Number])

CORRECT -> (Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today()))'}>} [Case Number]))

Last Year's YTD Records: NOT WORKING...

WRONG -> Count({[Date/Time Opened.autoCalendar.Year]={"$(=Year(Today())-1)"}>}[Case Number])

CORRECT -> =(Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today())-1)'}>} [Case Number]))

' and " got confused along with parenthesis placement.  Thanks to all since it's all the previous advice I've saved that helped me see the error.