Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
i want to create a TextBox which counts the distinct values of a certain field. The user should be able to select the field in which the values get countet by using the $Field listbox.
I created a texbox with the following Code:
=Count(Distinct(GetFieldSelections($FIeld))
Instead of getting the distinct Count of the selected field in the listbox $Field, i only get a 1 if something is selected and 0 if nothing is selected.
best regards,
BHoll
Try it with: = count(distinct [$(=$Field)])
- Marcus
Hi Marcus,
working perfectly fine with you syntax, thank you.
Can you explain to me how the dollar and equal sign gets interpreted by QlikView in your formula?
And whats the reason that my formula didn't work. Is it not possible to pass a Fieldname to a function like this?
The result of a Qlik expression is either a number or a string but not a field - completely independent if it looked like a valid fieldname. Unfortunately there is no evaluate() function available within the UI so that the only possibility to resolve any string as field is to store it as a variable.
My example is called a $-sign expansion and creates an adhoc-variable which are always evaluated at first on a global level and those results are treated as if the user has written them manually.
More to this could you find here: The-Magic-of-Dollar-Expansions
- Marcus