Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
valerio_trotta
Contributor III
Contributor III

Pivot colum total percentage without directly specify column field name

Hi everybody,

 

i don't know if it's possible but i'm calculating a measure in a pivot as the percentage of column total with this expression

 

count(fieldName)/count(TOTAL <columnFieldName> fieldName)

 

Is it possible to not specify the column filed name and let a function or something else determine it?

 

Thanks

VT

5 Replies
dilipranjith
Partner
Partner

You could try with variable like below
um(LineSalesAmount)/Sum(total<$(vDimDynamic2)>LineSalesAmount)
valerio_trotta
Contributor III
Contributor III
Author

 

 

dilipranjith
Partner
Partner

the column name you want to use as total e.g.

if your column is Year. Define the variable as Year

valerio_trotta
Contributor III
Contributor III
Author

That's kind of what i was hoping to avoid, to specify the name of the field.

 

So far i'm using a variable defined as  GetObjectField(2) which works fine in this case because i have two dimensions on the rows and only one on the cols in this pivot, if i use it in a different format of pivot table it won't work correctly. 

In the end i'd like to avoid writing the dimension name at any level, if it's possible.

 

Thanks

VT

dilipranjith
Partner
Partner

i am not sure what your exact requrirements are. Only thing i can do is point your in rought direction which is to use the variable and make it dynamic on someway