Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Customs Totals

Hi, I need to format the columns different than the total. I have this Expression:

if (dimensionality()=0,

Num(Sum(aggr($(vCalcCost2_1) , $(vLocGroupF) )) ,'#,##0'),

Num($(=vCalcCost2_1)
,'#,##0.000')

)

the variable vLocGroupF = 'GetCurrentField(grpLocal)';

Qlikview retrives well the name of the  dimmension.  But the Formula does not work for the total the result is always 0. I try with  $(=$(vLocGroupF))  but does not work. Any ideas?

thx a lot.

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi I solved, I ceated a big variable with both expressions:

vbigvar$(vDimSet)_$(vCol) =
'aggr( ' 
& 
'(('&Chr(36)&'(=concat(_PCalc'&
$(vDimSet)&'_'&$(vCol)&','&Chr(39)&'+'&Chr(39)&')))
/If(Len(GetFieldSelections(_ShowCostPerTon'&
$(vDimSet)&'_'&$(vCol)&'))
,
'&Chr(36)&'(vCalcQty'&
$(vDimSet)&')
,10000))'
& ' , '   &
$(vLocGroupF) & ')';

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

1) Are you doing this in a pivot table??? If not and you are using a straight table, I would suggest using Straight tables inbuilt total mode instead of Aggr and Dimensionality().

2) What is the definition of $(vCalcCost2_1)? May be this is the reason your expression is yielding you the result 0

Not applicable
Author

Hi sunindia .

1) It is a Chart table. How can I use straight table inbuilt total mode? Could you give me an example please?

2) Let  vCalcCost$(vDimSet)_$(vCol)='(('&Chr(36)&'(=concat(_PCalc'&$(vDimSet)&'_'&$(vCol)&','&Chr(39)&'+'&Chr(39)&')))
/If(Len(GetFieldSelections(_ShowrTon'&
$(vDimSet)&'_'&$(vCol)&'))
'&
Chr(36)&'(vCalcQty'&$(vDimSet)&') ,10000))'.

No the expresion works good when i have an static dimension. Example:
Num(Sum(aggr($(vCalcCost2_1) , Country) )) ,'#,##0')


Thx a lot for your answer.

Not applicable
Author

sunindia, I can not use straight table inbuilt total mode because I need different format for the total.

Not applicable
Author

Hi I solved, I ceated a big variable with both expressions:

vbigvar$(vDimSet)_$(vCol) =
'aggr( ' 
& 
'(('&Chr(36)&'(=concat(_PCalc'&
$(vDimSet)&'_'&$(vCol)&','&Chr(39)&'+'&Chr(39)&')))
/If(Len(GetFieldSelections(_ShowCostPerTon'&
$(vDimSet)&'_'&$(vCol)&'))
,
'&Chr(36)&'(vCalcQty'&
$(vDimSet)&')
,10000))'
& ' , '   &
$(vLocGroupF) & ')';

sunny_talwar
MVP
MVP

Awesome, I suggest marking your own answer as correct and closing this thread.

Best,

Sunny