Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have to sort a table by dimension where all the selected values should come on top. What will be the macro for that ??
Hi,
You can do it without macro.
Use Sort by Expression in the sort Tab of the chart properties.
=if(Match(FieldName,$(=chr(39)&GetFieldSelections(FieldName,chr(39)&','&chr(39),20)&chr(39))),0,1)
Instead of 20 you can use maximum number of field values.
Celambarasan
Hi
What is the type of sheet object you want this to achieve/
Darius
the type of sheet object is straight table
Hi
It is better to use list box for that. In QV11 it allows expressions. In this case you will have a posibility to sort selected values at the top and excluded at the bottom.
Cheers
Darius
I can not do that. My requirement is such that i have to display the volumes of different products in one table and if i select multiple products. the selected products should be highlighted and the remaining products should also be listed there. But all the selected products should be at the top of the table.
Hi
Try this example as starting point
Cheers
Darius
Hi
That's not the way Qlikview normally works. Normally, list boxes will display all values, and (depending on the sort criteria) put the selected items on top. Straight tables will only display selected items, non-selected items, or items excluded by selections on other fields will not display at all.
There are some tricks to override the bahaviour in list boxes, but you cannot change the selection behaviour in straight tables.
What you can do is create an island field (eg ProductIsland in DataIsland table) for the products you want to highight. Display this in a list box so you can make select products to highlight.
=chr(39) & GetFieldSelections(ProductIsland, chr(39) & ',' & chr(39), 10) & chr(39)
(where 10 is the maximum number of selections to allow)
Enter an expression something like:
eg for background:
If(Dimensionality()>0 And Match(Product, $(vTest)) <> 0, Yellow())
If(Match(Product, $(vTest)), 'z', 'a') & Product
See the attached.
Regards
Jonathan
Edit: Darius' example is better than mine, I think ![]()
Hi,
You can do it without macro.
Use Sort by Expression in the sort Tab of the chart properties.
=if(Match(FieldName,$(=chr(39)&GetFieldSelections(FieldName,chr(39)&','&chr(39),20)&chr(39))),0,1)
Instead of 20 you can use maximum number of field values.
Celambarasan