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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

total within set expression

Hi !  Dear Fellows

I have a problem of restricted total amount .

The Chart dimension is period .

The expression like 'sum({$< PeriodID = { 4,5,6 } > total Amount ) '   including all amount value .

Is there good way to solve this problem ?

The data is

Period   Amount

1           100

2           200

3           300

4           400

5           500

6           600

The Target is

Period  Amout  Total    Rate

4           400      1500   4/15

5           500      1500   5/15

6           600      1500   6/15

1 Solution

Accepted Solutions
sunny_talwar

I am not sure I understand what are you looking for? You don't want to use this to get Rate?

Sum({$<PeriodID = { 4,5,6 }>}Amount)/Sum(TOTAL {$<PeriodID = { 4,5,6 }>}Amount)

Can you please clarify what exactly is the concern here?

View solution in original post

3 Replies
sunny_talwar

I am not sure I understand what are you looking for? You don't want to use this to get Rate?

Sum({$<PeriodID = { 4,5,6 }>}Amount)/Sum(TOTAL {$<PeriodID = { 4,5,6 }>}Amount)

Can you please clarify what exactly is the concern here?

Anil_Babu_Samineni

What do you want here,

You want show two dimensions along with 2 Expressions which is Total and Rate or what?

Please effort here to post As soon as you can ...!

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

I am sorry to say ' Thank you ' lately .

The sample is too simplified . It is my mistakes.

The real  problem was  denominator is  Aggr(count ( total {$<PeriodID = { 4,5,6 }>}distinct Customer),periodID) 

I confused that  aggr problem and sum is same problem. So I posted the simplified problem.

Using Aggr function , I couldn't find the unchanged denominator value with period dimension .

Finaly I defined the variable , and fixed the problem.

Thank you quick reply and I am sorry again the late reply.

Jei H. Cho