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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DWolsie
Contributor III
Contributor III

Measure, variable or field creation and non acceptance in Formulas

Hello everyone,

I've been struggling recently with one of my dashboard as a few of my created elements are not recognized in the way I want them to be. I want to use the created Master-element COSP Budget in a formula for a KPI like this:

DWolsie_0-1729242216594.png

However, as you can see, this creates an error message as I believe this is a "kennzahl" instead of a "feld" (german terms).

The formula for this master-element consists of these further master elements:

DWolsie_1-1729242344795.png

These master elements, in turn, all have formulas that look like this:

DWolsie_2-1729242397316.png

This data comes from the data-editor in a code that looks like this:

DWolsie_3-1729242464961.png

So my question is, what part do I need to change in any section, for my created variables to not produce errors in the first picture? Thanks in advance!

Labels (1)
2 Solutions

Accepted Solutions
diegozecchini
Specialist
Specialist

Hi!
In your first screenshot, you're using Sum([COSP Budget]) - sum([Betrag offen (LC)]) / Sum([COSP Budget]) * (Month(Today())/12). It’s likely the error occurs because:

[COSP Budget] could be defined as a master measure and not a field. Measures are treated as aggregations, and you cannot use them in certain operations as you would a field.
If [COSP Budget] is not a simple field (but a calculated measure), Qlik might be expecting it to behave differently in expressions.

Check if COSP Budget is a calculated measure. If it is, wrap it with the proper aggregation function (like Sum or Avg) based on your use case.
If [COSP Budget] is a complex formula defined through other master elements, ensure that each element used is also aggregated properly.

In the second and third screenshots, you show the formulas for intermediate master elements. If these elements are again using fields like [COSP.WRTTP] or [COSP.VERSN], and calculations are being performed without proper aggregation functions, you’ll face issues when combining them.

Make sure every component in your formulas is properly wrapped within aggregation functions (Sum, Avg, etc.) and tested for field existence.


In the final screenshot, Double-check the data load script to ensure that all fields used in your master elements are properly loaded and named.
Avoid using similar names for master elements and actual fields to prevent confusion during formula creation.

Hope it helps,
kind regards,
Diego

View solution in original post

Kushal_Chawda

@DWolsie  That's what I mentioned, remove sum() just use [COSP Budget]  - sum(Betrag...)

View solution in original post

6 Replies
diegozecchini
Specialist
Specialist

Hi!
In your first screenshot, you're using Sum([COSP Budget]) - sum([Betrag offen (LC)]) / Sum([COSP Budget]) * (Month(Today())/12). It’s likely the error occurs because:

[COSP Budget] could be defined as a master measure and not a field. Measures are treated as aggregations, and you cannot use them in certain operations as you would a field.
If [COSP Budget] is not a simple field (but a calculated measure), Qlik might be expecting it to behave differently in expressions.

Check if COSP Budget is a calculated measure. If it is, wrap it with the proper aggregation function (like Sum or Avg) based on your use case.
If [COSP Budget] is a complex formula defined through other master elements, ensure that each element used is also aggregated properly.

In the second and third screenshots, you show the formulas for intermediate master elements. If these elements are again using fields like [COSP.WRTTP] or [COSP.VERSN], and calculations are being performed without proper aggregation functions, you’ll face issues when combining them.

Make sure every component in your formulas is properly wrapped within aggregation functions (Sum, Avg, etc.) and tested for field existence.


In the final screenshot, Double-check the data load script to ensure that all fields used in your master elements are properly loaded and named.
Avoid using similar names for master elements and actual fields to prevent confusion during formula creation.

Hope it helps,
kind regards,
Diego

DWolsie
Contributor III
Contributor III
Author

Hi Diego,

Thanks for the swift response. I have now double checked to make sure each individual master element is summed as such:

DWolsie_0-1729243670819.png

However, when I then try to sum the COSP Budget I get the following error message:

DWolsie_1-1729243879896.png

Any idea what the problem could be?

Kushal_Chawda

@DWolsie  If [COSP Budget]  is master measure you don't need to apply any aggregation function over it, actually it is now allowed. You can simply call master measure as is.

DWolsie
Contributor III
Contributor III
Author

Hi Kushal,

Unfortunately, doing so I still get the error message 😞

DWolsie_0-1729244484728.png

 

Kushal_Chawda

@DWolsie  That's what I mentioned, remove sum() just use [COSP Budget]  - sum(Betrag...)

DWolsie
Contributor III
Contributor III
Author

Ahhh thank you so much! It works now!