Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Antoine5531
Contributor II
Contributor II

Get a list of the table's dimensions in the table expression

Hello,

I'm working with a pivot table having an expression like :

sum(TOTAL <Year,CAT> If(Month='01',Amount))

 Some of the users now want to be able to add new dimension (like sub-cat) to the table. The logic thing is to add sub_cat to the expression (after CAT). I need to make the expression handle that.

Do you know if there is any way to get a list of the dimensions used in the table ?

Thanks

Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If it helps, know that the TOTAL list can include fields that are not in the table.  Those additional fields will be ignored until they are in the table. e.g. you can use 

sum(TOTAL <Year,CAT,sub-cat,Customer> If(Month='01',Amount))

sub-cat will come into play only when it is in the pivot table. 

That said, if you want to build the list dynamically, GetObjectField(n) will return the name of the Dimension at index n.  

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If it helps, know that the TOTAL list can include fields that are not in the table.  Those additional fields will be ignored until they are in the table. e.g. you can use 

sum(TOTAL <Year,CAT,sub-cat,Customer> If(Month='01',Amount))

sub-cat will come into play only when it is in the pivot table. 

That said, if you want to build the list dynamically, GetObjectField(n) will return the name of the Dimension at index n.  

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

stevejoyce
Specialist II
Specialist II

I've used a listbox (island table) that has available dimensions to use in your table.  If you do this then you can determine which dimensions are in the pivot table with getfieldselections().

If it's "self-service" drag and drop add, I don't know how you can change your expression just by determining which dimensions are used in a table.

Antoine5531
Contributor II
Contributor II
Author

Thanks a lot