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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Zeljko
Contributor II
Contributor II

straight table qoute over two columns

Hi,

I have a problem to calculate the qoute over two colums in a straigt table.
The problem is that a master of a department have more teamleaders and for the teamleaders there are same people which work for more teamleaders not only for one. In my fact Table I create this relations.
The first 3 Colums in the Table 2 are right calculated but I can not calculate the Column 4 ("KRANK Qu % Gesamt").
The expression for this ist Column 3 ("Krank Gesamt") / Column 2 ("SOLL"). The rigtht Value forthe total line should be
16 / 2705 = 0.0059 --> 0.59%.
Can any one help me to find a right expresion for this issue?

QlikView04_Test_Server.jpg

Example qvw "Abwesenheitsstatistik_TEST.qvw" see attachment.

Thank you for help.

Zeljko

Labels (1)
1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

you have to use aggr

Sum(Aggr(if(len(Only(PERS_TLName))>=1,sum(SumKrank),sum(distinct SumKrank)),PERS_KRANKM))/Sum(Aggr(if(len(Only(PERS_TLName))>=1,sum(SumSOLL),sum(distinct SumSOLL)),PERS_KRANKM))

View solution in original post

2 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

you have to use aggr

Sum(Aggr(if(len(Only(PERS_TLName))>=1,sum(SumKrank),sum(distinct SumKrank)),PERS_KRANKM))/Sum(Aggr(if(len(Only(PERS_TLName))>=1,sum(SumSOLL),sum(distinct SumSOLL)),PERS_KRANKM))

Zeljko
Contributor II
Contributor II
Author

Thank you!

It works now!

Best Regards
Zeljko