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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator III
Creator III

Sum from current year AND selection

Hi,

I have a small problem. I have the KPI SALES for the current year and next to it a diagram with the months of this year as a dimension.

I have used the following formula so far:

Sum({$<$(GUI_CAL_PA_SET(year,0)), Sales.Open = {'0'}> } Sales)

GUI_CAL_PA_SET = Definition of time

This ensures that the current year and not all values ​​are always displayed. But I would like that when a dimension is selected in the diagram, the corresponding value of the month is output.

What do I have to change in the formula so that the selection overrides the entire year and shows the values ​​of the month?

 

1 Solution

Accepted Solutions
Andrea_Bertazzo
Support
Support

Hi,

I am not sure  that I have understood the question. You want to show the month value if a month is selected or the year if no month selection is made. Is this correct? If so, I would try with an IF,  something like:

=if(GetFieldSelections(Month), Sum( Month), Sum({$<$(GUI_CAL_PA_SET(year,0)), Sales.Open = {'0'}> } Sales))

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up ! 🙂

View solution in original post

1 Reply
Andrea_Bertazzo
Support
Support

Hi,

I am not sure  that I have understood the question. You want to show the month value if a month is selected or the year if no month selection is made. Is this correct? If so, I would try with an IF,  something like:

=if(GetFieldSelections(Month), Sum( Month), Sum({$<$(GUI_CAL_PA_SET(year,0)), Sales.Open = {'0'}> } Sales))

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up ! 🙂