Skip to main content

New to Qlik Sense

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

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
dplr-rn
Partner - Master III
Partner - Master III

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

 

 

dplr-rn
Partner - Master III
Partner - Master III

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

dplr-rn
Partner - Master III
Partner - Master III

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