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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
HS_1
Contributor II
Contributor II

Calcul a Measure fixed in a year

 

Hello everyone,

In Qlik Cloud, I want to create budget measures that remain fixed for the entire year. For example, if the budget for Nature1 (in the field Nature) is 10,000, I want this value to stay the same no matter which quarter or month I select.

This is what I've done

Sum( Aggr( Sum({< Year = {"$(=If(GetSelectedCount(Year)=0 or IsNull(GetFieldSelections(Year)) or GetFieldSelections(Year)='', Year(Today()), Max(Year)))"}, Month=, Quarter=, Date= >} Budget), Year, Zone, Nature ) )

The problem is that I have to list manually all the fields (Year, Zone, Nature, etc.) in the Aggr() function and also it don't give me the correct resutl.

Is there a way to fix the budget values for the whole year without having to list all the fields manually in the Aggr or set analysis? Or is there a better approach to achieve this?

Thanks in advance for your help!

Labels (4)
3 Replies
JHuis
Creator III
Creator III

What are you looking to archieve? to create a table or something like that? 

 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @HS_1 ,

Well, to "fixate" the annual budget in a layout object, you'll have to do something of this kind, and the specifics really depend on the composition of your sheet objects - tables, charts, etc... You may or may not need the AGGR() function. You may not need to use field selections for this purpose. You might be able to use the TOTAL qualifier in certain situations, but not always.

Hence a valid question by @JHuis - what are you trying to accomplish? More specifically, in what sheet objects are you trying to show the annual budget, and what are the corresponding Dimensions in these charts? That will determine the best solution for the problem.

Cheers,

Oleg Troyansky

 

Ask me about Qlik Sense Expert Class!
anat
Master
Master


=Sum({1< Year = {"$(=If(GetSelectedCount(Year)=0 or IsNull(GetFieldSelections(Year)) or GetFieldSelections(Year)='', Year(Today()), Max(Year)))"}, Month=, Quarter=, Date=, Zone, Nature >} Budget)

but need clarification on where you are using these expression like in table or kpi?