Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
PLE
Contributor II
Contributor II

Sum if less than variable value

Dear community, I'm trying to make a sum of numbers based on the year being less or equal to a variable.

I tried both these set expressions:

Sum({<[Reporting Date.autoCalendar.Year] ={"<=$(=vCurrentYear)"}>} Actuals)

and

Sum({<[Reporting Date.autoCalendar.Year]={"<=$(=$(vCurrentYear))"}>} Actuals)

 

For some reason, neither expression is showing any data.

Anybody any ideas please.

Thanks,

3 Replies
Kushal_Chawda

@PLE  Your measure looks fine. What is the expression of vCurrentYear variable? Make sure that your variable expression works and giving year value. Seems like your variable expression evaluating NULL value which is causing this issue.

PLE
Contributor II
Contributor II
Author

I thought about that, but the formula bar below the editor shows clearly {"<=2021"}

So I consider the variable correct.

When I take the variable in a KPI chart, it shows current year 2021.

When I use the formula with "=" instead of "<=" it works fine as well.

PLE
Contributor II
Contributor II
Author

@Kushal_Chawda , I solved the problem for now.

I defined a Year(Reporting Date) in my load script rather than using the autocalendar.

The formula works perfect when using this field instead of the autocalendar.year field.