Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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) & ')';
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
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.
sunindia, I can not use straight table inbuilt total mode because I need different format for the total.
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) & ')';
Awesome, I suggest marking your own answer as correct and closing this thread.
Best,
Sunny