Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to ignore dimension for sum in expression


Hello,

I want make a sum in a expression but a join in my load script duplicate some data, for example

id;mynumber;otherid,somedataofotherid

1;25;87;somedata1

1;25;88;somedata2

How to sum mynumber and have 25 for result, I want to ignore otherid and  somedataofotherid ? I have also lot of filter and i use lot of if to filter my data

Perhaps it's not possible ?

Thanks in advance

Christophe

3 Replies
Gysbert_Wassenaar

Try sum({<otherid=,somedataofotherid=>}distinct mynumber)


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you for the response but unfortunatly it does not work for me.
Please find enclosed test project,
Your solution is working if I use distinct in expression, but if I add an other id to keep I want to have 50 for result (25 for otheridtokeep = 8 + 25 for  otheridtokeep  = 9) for id_statut = 1 (and not 75)
datatest:
LOAD * INLINE [
id_statut, mynumber, otherid, otheriddata, otheridtokeep
1, 25, 58, otherdata1,8
1, 25, 87, otherdata2,8
1, 25, 87, otherdata2,9
2, 41, 48, otherdata3,1
2, 41, 46, otherdata4,2
3, 25, 49, otherdata5,3
3, 24, 57, otherdata6,4
]
;
Thanks for your help.
Christophe
Gysbert_Wassenaar

Try sum(aggr(sum(distinct mynumber),id_statut,otheridtokeep))


talk is cheap, supply exceeds demand