Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
ericheleine
New Contributor

Problem with aggr() or only()

Hi every body,

My goal is to calculate the total cost only with bank where i have an interaction

I don't arrive to fix this issue with the function aggr

  

BankInteraction per month
Bank115
Bank212
Bank35
Bank44
Bank50
Bank60
Bank70

 

BankCost
Bank110000
Bank210000
Bank3

10000

Bank410000
Bank510000
Bank610000
Bank7

10000

Total cost expected is 40000

thanks for your help

1 Solution

Accepted Solutions

Re: Problem with aggr() or only()

Or may be this if you don't have a pre-aggregated Interaction per month column

Sum({<Bank = {"=Count(Interaction) > 0"}>} Cost)

6 Replies
MVP
MVP

Re: Problem with aggr() or only()

Try something like:

Sum( {<[Interaction per month]={'>0'}>} Cost)

Re: Problem with aggr() or only()

Or may be this if you don't have a pre-aggregated Interaction per month column

Sum({<Bank = {"=Count(Interaction) > 0"}>} Cost)

ericheleine
New Contributor

Re: Problem with aggr() or only()

thank you Tresesco for your quick answer.

that doesn't work because Interaction per month is a formula:
=count(interaction)

The set analysis doesn't work in this case

eric

MVP
MVP

Re: Problem with aggr() or only()

Then Sunny's suggestion below should work.

ericheleine
New Contributor

Re: Problem with aggr() or only()

thank sunny

works perfectly

regards

Re: Problem with aggr() or only()

Do you have just Bank as dimension or do you have Bank and Month as dimension? If you just have Bank as dimension, then you can try this

Sum({<Bank = {"=Count(Interaction) > 0"}>} Cost)

If you have Bank and Month as dimension, then may be create a new field in the script like this

LOAD Bank,

    Month,

    Bank&Month as Key

    ....

FROM ....;

and then this

Sum({<Key = {"=Count(Interaction) > 0"}>} Cost)

Community Browser