Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Distinct Gross sum

officeGeomanagergross
1112299
2222299
3321608
3323333
2214608

Expecting O/P as Distinct values and Sum as follows in a Pivot Table Got Distinct values need Sum(premiums)

ABCDistinctSum(gross)
office311(299),22(907),33(941)
Geo21(907),2(1240)
Manager42(598),1(608),3(333),4(608)
1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dimension:

Add Calculated Dimension: =ValueList('Amount', 'Manager', 'Geo-code', 'Office')

Expression:

Distinct

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Amount', Count(DISTINCT Amount),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Geo-code', Count(DISTINCT [Geo-code]),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Manager', Count(DISTINCT Manager),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Office', Count(DISTINCT Office)))))

Distinct1

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Manager', Concat(TOTAL Aggr( Sum(gross) & '(' & MaxString(Manager) & ')', Manager), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Amount', Concat(TOTAL Aggr( Sum(gross) & '(' & Amount & ')', Amount), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Geo-code',Concat(TOTAL Aggr( Sum([gross]) & '(' & [Geo-code] & ')', [Geo-code]), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Office',  Concat(TOTAL Aggr( Sum(gross) & '(' & Office & ')', Office), ', ')))))

Hope this helps you.

Regards,

Jagan.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

can any one Help in this while writting set analysis not getting exactly.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dimension:

Add Calculated Dimension: =ValueList('Amount', 'Manager', 'Geo-code', 'Office')

Expression:

Distinct

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Amount', Count(DISTINCT Amount),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Geo-code', Count(DISTINCT [Geo-code]),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Manager', Count(DISTINCT Manager),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office')='Office', Count(DISTINCT Office)))))

Distinct1

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Manager', Concat(TOTAL Aggr( Sum(gross) & '(' & MaxString(Manager) & ')', Manager), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Amount', Concat(TOTAL Aggr( Sum(gross) & '(' & Amount & ')', Amount), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Geo-code',Concat(TOTAL Aggr( Sum([gross]) & '(' & [Geo-code] & ')', [Geo-code]), ', '),

if(ValueList('Amount', 'Manager', 'Geo-code', 'Office') ='Office',  Concat(TOTAL Aggr( Sum(gross) & '(' & Office & ')', Office), ', ')))))

Hope this helps you.

Regards,

Jagan.

Anonymous
Not applicable
Author


Thanx jagan You Helped the day.First project on QlikView can i know Better Approach Dig more on Set Analysis & Scripting

jagan
Luminary Alumni
Luminary Alumni

Hi,

Refer Qlikview Reference Manual and Qlikview 11 for Developers books and follow the community postings, if possible try to answer.

Please close this thread.

Regards,

Jagan.