Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
datadiva
Contributor II
Contributor II

Creating Dimension based off of dynamic Year calculation

Hi,

 

I'm new to QlikSense, and I'm trying to make a chart that we had in another BI Tool.  In order to do this, I need to calculate the Sum of the Net Amount for the year separated out by month, but only for the current year.  So this will require 12 different calculations and be set up in a table so that management can see each month listed at the top with the Sales team / person  to the left and show the achieved amount for each month for the whole year.

To calculate September's Net Revenue, I used this:

MONEY(Sum({$<Year={2023}>*1<Month={'Sep'}>}
[Net Amount]*IF(ISNULL([Split Percent]), 1, [Split Percent])), '$#,##0.00')

The calculation above works to give what I need (and gives me the formatting too), however, I cannot just replace the '2023' with YEAR(Today()) as it throws an error.  How can I get this expression to allow me to have it dynamically pull in the current year where '2023' is currently hardcoded (other charts in the dashboard show both past performance and forecasts so I need to do this at the chart level)?

Labels (4)
1 Solution

Accepted Solutions
Or
MVP
MVP

Apologies - looks like I had a typo in the original (and the quotes weren't necessary).

Year={$(=Year(Today()))}  

 

View solution in original post

3 Replies
Or
MVP
MVP

Year={$(=Year(Today()))}
datadiva
Contributor II
Contributor II
Author

I'm not sure where I put that to make it work correctly.  I tried this:

MONEY(Sum({$<Year={Year={"=$(Year(Today()))"}}>*1<Month={'Sep'}>}
[Net Amount]*IF(ISNULL([Split Percent]), 1, [Split Percent])), '$#,##0.00')

And it said there was an error in the expression, so I tried this:

MONEY(Sum({$<Year={"=$(Year(Today()))"}>*1<Month={'Sep'}>}
[Net Amount]*IF(ISNULL([Split Percent]), 1, [Split Percent])), '$#,##0.00')

But then the amounts all zeroed out.  What did I do wrong?

Or
MVP
MVP

Apologies - looks like I had a typo in the original (and the quotes weren't necessary).

Year={$(=Year(Today()))}