Is it possible to use an expression as the dimension within an aggr() function. The field that I am trying to aggr() on is an inputfield. In order for the inputfield to behave like other fields in that it stores and represents every unique value of the field, I have to use the formula:
=text(inputfield). I'm wanting to do the following...aggr(sum(sales),text(inputfield)). This does not seem to be working and I think it's because of the expression which is used as the dimension in the aggr() function. How else can this be done?
Inputfields will not work within the Aggr() function. They will not work as dimensions even if you don't use the Aggr(), note how the ID in the attached application is an inputfield and how the straight table does not aggregate by ID, but it does when you change the script to make to rows have the same ID. QlikView "knows" somehow that the value is not it's not the source value, and although it displays the new entered value, does not aggregate it, as you can see in the file.
The idea on inputfields as far as I'm concerned is not about dimensions, rather than expressions, meaning that they are inteded to store numeric values that can change and may affect to some aggregations that in turn must use their own functions, like InputSum() or InputAvg().
By the way, I'm using version 11, and I have not tested it in previous versions, but I guess they behave likewise.
The inputfield does work as a dimension in the table on the right if you change the dimension from 'ID' to =Text(ID). In other words, inputfields treat every value in them as unique, even if they are identical in content. But when you use the 'Text' function, it groups like values together in the input field so that it behaves like any other normal field. Therefore, it can be used as a dimension with this slight workaround. I'm wanting to know if there is some way to perform aggregation on this Text(inputfield) value either using aggr() or set analyis or some other method.