# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for
Did you mean:
Highlighted
Contributor

## If statement not updating both rows

Hi All,

I have a table in which I am trying to compared two organisations views of data, which has already been pulled into one table (by someone else) however there have been areas in which items don't match within their process, due to the POD being different.

I therefore am trying to build in some more logic into my own work to cut down on the differences and 'auto comment' items so I know I don't need to look into things in more detail, so long as certain criteria match, such as the same customer having the same cost.

I have therefore put in the following calculated dimension for 'Our Comment'

if(Aggr(sum(PriceActualDiff),MasterID)>=-5 and Aggr(sum(PriceActualDiff),MasterID)<=5,'Match','Different')))

The column titled 'Price - Diff (Rounded)' is just the PriceActualDiff within the base data, shockingly rounded.

Unfortunately this is only putting a comment of match on one row of data and leaving the other row as different.

any ideas on how to get around this?

1 Solution

Accepted Solutions
Highlighted
MVP

Try this

If(Aggr(NODISTINCT Sum(PriceActualDiff), MasterID) >= -5 and Aggr(NODISTINCT Sum(PriceActualDiff), MasterID)<= 5, 'Match', 'Different')))

3 Replies
Highlighted
MVP

Try this

If(Aggr(NODISTINCT Sum(PriceActualDiff), MasterID) >= -5 and Aggr(NODISTINCT Sum(PriceActualDiff), MasterID)<= 5, 'Match', 'Different')))

Highlighted
Master III

if(Aggr(sum(PriceActualDiff),MasterID,POD)>=-5 and Aggr(sum(PriceActualDiff),MasterID,POD)<=5,'Match','Different')))

Highlighted
Contributor

oh thanks, that's done it perfectly