Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
esraltnl
Contributor
Contributor

total issue-distinct id

Hi everyone,

I have a dataset like the one below. 

MonthidValue
Jan115
Jan225
Feb225
Feb35
Feb410

 

I want to sum the "Value " according to the distinct id field. First I want to find the total values by months, but then compare the total value over all months. And I want the result as follows. How can I do it, can you help?

monthsum(value)
total55
jan40
feb40

 

Hope you can help me

1 Solution

Accepted Solutions
MayilVahanan

Hi @esraltnl 

For Total alone, you want to change the value, in that case, try like below

If(RowNo() =0 or IsNull(RowNo()), sum(aggr(sum(distinct Value),id)), Sum(Value))

MayilVahanan_0-1620742644863.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
Taoufiq_Zarra

in script ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
esraltnl
Contributor
Contributor
Author

script

data:
LOAD * Inline [
Month,id,Value
Jan,1,15
Jan,2,25
Feb,2,25
Feb,3,5
Feb,4,10
];

set analysis

sum(aggr(sum(Value),id,Month))

image.png

MayilVahanan

Hi @esraltnl 

For Total alone, you want to change the value, in that case, try like below

If(RowNo() =0 or IsNull(RowNo()), sum(aggr(sum(distinct Value),id)), Sum(Value))

MayilVahanan_0-1620742644863.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
esraltnl
Contributor
Contributor
Author

Hi @MayilVahanan 

thank you for answering