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: 
Qlik1_User1
Specialist
Specialist

How to manually add plus two year in chart

Hi,

is it feasible if we can added two year manually in bar chart.

Data

Year Amount

2021 100
2022  500
2023 100
2024 200
2025 300

Chart - bar chart

Dimension =IF(GetSelectedCount(reporting_year)=0,aggr(If(reporting_year>=$(=Max(reporting_year))-2,reporting_year), reporting_year),reporting_year)

Measure = SUM(Amount)

Can we manually add 2026, 2027  in dimension via expression 

Expected data in year - 2023, 2024, 2025, 2026, 2027
please suggest.

 

2 Replies
marcus_sommer

It's not possible to show any calculation against a not existing dimension-value. Means an appropriate dimension-value must be provided.

Such creation is in general possible within the UI with a calculated dimension, for example with valuelist() and valueloop() but it comes with a lot of disadvantages. Better will be to create all wanted data within the data-model.

marcus_sommer

In addition a simple way to add future years may be:

concatenate(MyFactTable)
load year(today())+ recno()  as Year, 0 as Amount, 'populated' as Source
autogenerate 2;

Afterwards an if-loop could be applied within the UI object to branch into different calculations in regard to the Source information. If the real case is a bit more complex you need some extending to the concatenation table (maybe including any ID's and already values or factors for the future periods).