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: 
Not applicable

variables with Class function

I have a variable (the variable is the total of several other variables) called vPricperton.  I would like to have a dimension for this but want to group the values.  I was trying to use the Class function with increments of 50 to create a caclulated dimension but it does not appear to work

Class($(vPriceperton),50)

The calculation of priceperton is donein variables within the UI and do not want to modify the data model to create another dimension.

4 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Adam,

I'm afraid you misunderstand the use of the Class function and/or the variables.

- The variable holds a single value (numeric or textual)

- The class function can be applied to a field, such as Price. With the class function, the field values can be divided into equally sized buckets.

I'm afraid it's impossible to bucketize a single value returned by the variable, unless I missed something that needs to be added here...

cheers,

Oleg Troyansky

Check out my new book QlikView Your Business: An expert guide to Business Discovery with QlikView an...

Not applicable
Author

Allow me to clarify

I have an expression stored in a vriable that I would like to use as a claulted dimension.  I am having issues getting the variable to work as a calculated dimesnion (have followed other threads on the topic and followed the syntax)

since my calcualted expression has multiple results (calculting price/ton) I would also like to somehow group the results as well

maybe the title was not the best and should have done a better job of explaining my requirements

jonathandienst
Partner - Champion III
Partner - Champion III

First develop the calculated dimension without using a variable. Once that is working correctly, you can convert to working with a variable quite easily.Doing it all in a single steps makes it hard to see what is not working correctly.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

I know the variable calcualtion is correct becasue I am using the expression on other charts and I get the correct result - the issue is using the expression as a calcualted dimension.