Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Partner
Partner

Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

Hi Expert,

i have created 2 different variable,

when apply claim wise aggr function it's getting null in calculated dimension but in expression value give.

for example if i am having claim wise 2 differnet figures of above two variable, but there is in first variable value is zero

and second variable is having some value so after applying aggr function over there claim wise. it's give me null values in calculated dimension but in expression this is working.

1st expression which is having 0 value -

aggr(sum({<[Link Flag]={'PAID'},[Claims Flag]={'TP'},[Link Date]={'<=$(vEndDate)>=$(vStartDateFY)'},[Link Month],[Link Quarter],[Link Year]>}[Gross Claim Paid Amount]),[Claim Number])

2nd expression which is having some values -

aggr(sum({<[No Claim Status]={'Repudiation','Closure','Withdrawn'},[Link Flag]={'NC'},[Claims Flag]={'TP'},[Link Date]={'<=$(vEndDate)>=$(vStartDateFY)'}>}[No Claim Expense Amount]),[Claim Number])


so when i add both expression (expr 1) + (expr 2) and show in calculated dimension its show null.


Kindly help thanx in advance.

1 Solution

Accepted Solutions
vishsaggi
Esteemed Contributor III

Re: Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

‌if you want to use in calculated dimensions you have to use aggr() around the expression...

like = aggr(your expression, fieldname)

4 Replies
Highlighted
olimonbi29
New Contributor II

Re: Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

Try this apparently a coma is missing:

aggr(sum({<[Link Flag]={'PAID'},[Claims Flag]={'TP'},[Link Date]={'<=$(vEndDate)>=$(vStartDateFY)'},[Link Month],[Link Quarter],[Link Year]>},[Gross Claim Paid Amount]),[Claim Number])

2nd expression which is having some values -

aggr(sum({<[No Claim Status]={'Repudiation','Closure','Withdrawn'},[Link Flag]={'NC'},[Claims Flag]={'TP'},[Link Date]={'<=$(vEndDate)>=$(vStartDateFY)'}>},[No Claim Expense Amount]),[Claim Number])


vishsaggi
Esteemed Contributor III

Re: Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

May be try this?

= Sum( aggr(sum({<[Link Flag]={'PAID'},[Claims Flag]={'TP'},[Link Date]={"<=$(vEndDate)>=$(vStartDateFY)"},[Link Month],[Link Quarter],[Link Year]>}[Gross Claim Paid Amount]),[Claim Number]))


= Sum( aggr(sum({<[No Claim Status]={'Repudiation','Closure','Withdrawn'},[Link Flag]={'NC'},[Claims Flag]={'TP'},

            [Link Date]={"<=$(vEndDate)>=$(vStartDateFY)"}>}[No Claim Expense Amount]),[Claim Number]))




Then use these expression to add. Use like RangeSum()


= RangeSum(FirstExprLabel, SecondExprLabel)

Partner
Partner

Re: Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

Thanks for your response Nagaraju,

same problem your approach is working in Expression but not working in Calculated Dimension.

when applying rangemax in dimension it's show Error (error in calculated Dimension).

vishsaggi
Esteemed Contributor III

Re: Variable value 0 after applying aggr its getting null in calcualted dim but in expression working .

‌if you want to use in calculated dimensions you have to use aggr() around the expression...

like = aggr(your expression, fieldname)