Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kevinstanfield
Partner - Creator
Partner - Creator

Retaining a Total Value in a Calculation

Hi I'm trying to fix a total to then display my selections as a %.

So the challenge is I  have set analysis as follows:

=(sum({$<USAGE_CHARGE_GROUP= {'VOICE'} >} ACTUAL_DURATION)/60)

Which gives me the total minutes where the USAGE_CHARGE_GROUP =  Voice. Want I want to be able to do is make a selection e.g. Calls to Italy and then the selection number of minutes to be divided by the Total minutes to show the % of total minutes that were calls to Italy.

I'm unable to get this to work.

Hope this is clear?

Thanks in advance.

Kevin

 

 

 

17 Replies
sunny_talwar

Ratio is not in minutes or seconds, ratio is a ratio and that is why you don't need 60 🙂

kevinstanfield
Partner - Creator
Partner - Creator
Author

Yes of course 

sunny_talwar

Okay so where do we stand? Do we have a solution yet 🙂

kevinstanfield
Partner - Creator
Partner - Creator
Author

I'm going to take a look this evening Sunny so will update tmrw - thanks

sunny_talwar

Sorry make sense. Let us know what you find.
kevinstanfield
Partner - Creator
Partner - Creator
Author

That's worked nicely guys - thanks, appreciated.

Just in terms of describing this behaviour to colleagues am I right in saying that any field added after the set analysis condition is set i.e. those in red  will be excluded from the set analysis and that many fields could be added?

Sum({$<USAGE_CHARGE_GROUP= {'VOICE'}>} ACTUAL_DURATION)/Sum({$<USAGE_CHARGE_GROUP= {'VOICE'}, CALL_CLASS,USAGE_CALL_GROUP>} ACTUAL_DURATION) 

 

Kevin

kevinstanfield
Partner - Creator
Partner - Creator
Author

Accepted as a solution

sunny_talwar


@kevinstanfield wrote:

 those in red  will be excluded from the set analysis

Sum({$<USAGE_CHARGE_GROUP= {'VOICE'}>} ACTUAL_DURATION)/Sum({$<USAGE_CHARGE_GROUP= {'VOICE'}, CALL_CLASS,USAGE_CALL_GROUP>} ACTUAL_DURATION) 


These fields in Red will ignore selection for the particular expression they are used in. If this is what you meant, then yes you are right 🙂


@kevinstanfield wrote:

that many fields could be added?


That is correct, you can ignore selection in as many fields as you would like. If you want to ignore selection in all fields, then use 1 instead of naming all the fields

Sum({$<USAGE_CHARGE_GROUP= {'VOICE'}>} ACTUAL_DURATION)/
Sum({1<USAGE_CHARGE_GROUP= {'VOICE'}>} ACTUAL_DURATION)