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: 
Metal-SheetKft
Contributor
Contributor

year to date in bar chart

How can I set a bar chart as year to date chart.

First bar: datas between 1. January this year and today

Second bar: datas between 1. January last year and the same day and month as today in the last year.

 

Labels (1)
1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

You can use set analyses to restrict the data:

CYTD: {<DateField={"<=$(=Today()) >=$(=YearStart(Today()))"}>}

PYTD: {<DateField={"<=$(=AddYears(Today(), -1)) >=$(=YearStart(AddYears(Today(), -1)))"}>}

You might have to add additional calendar fields to the expression so they can be ignored:

{<MonthField=, YearField=, DateField={"<=$(=Today()) >=$(=YearStart(Today()))"}>}

View solution in original post

1 Reply
LRuCelver
Partner - Creator III
Partner - Creator III

You can use set analyses to restrict the data:

CYTD: {<DateField={"<=$(=Today()) >=$(=YearStart(Today()))"}>}

PYTD: {<DateField={"<=$(=AddYears(Today(), -1)) >=$(=YearStart(AddYears(Today(), -1)))"}>}

You might have to add additional calendar fields to the expression so they can be ignored:

{<MonthField=, YearField=, DateField={"<=$(=Today()) >=$(=YearStart(Today()))"}>}