# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
Not applicable

## Help filtering data

To simplify this example, imagine I have a tab with inventory such as:

NameActual_pricePrice_before
Water54
Beer89
Coke6.56.5

Then, on a different tab, I want to count the number of items that have the same Actual_price and Price_before (like coke and lemonade in this example).

I'm trying to use something like this Count({<Actual_price={Price_before}>} Name). I'm guessing the solution should be fairly simple, but I've tried different variations without luck, I would appreciate any help.

Tags (3)
1 Solution

Accepted Solutions
Honored Contributor

## Re: Help filtering data

If these are in the same table, you can just add a flag for this as a field in the script:

If(Actual_price=Price_before,1,0) as SamePriceFlag

Then you can use Set Analysis to count the number of products with the same before and after price:

Sum({\$<SamePriceFlag={1}>} SamePriceFlag)

5 Replies
Not applicable

## Re: Help filtering data

Try Like:

Count(If(Actual_price=Price_before,Name,0))

or

If( Actual_price=Price_before,Count(Name),0)

Regards

R

Honored Contributor

## Re: Help filtering data

If these are in the same table, you can just add a flag for this as a field in the script:

If(Actual_price=Price_before,1,0) as SamePriceFlag

Then you can use Set Analysis to count the number of products with the same before and after price:

Sum({\$<SamePriceFlag={1}>} SamePriceFlag)

Honored Contributor

## Re: Help filtering data

Hi biel.II.s,

Let do this IF(Actual_price=Price_before,COUNT([Name]))

Do let me know after you tested it.

Regards,

Sokkorn

Not applicable

## Re: Help filtering data

Johannes, thank you for your answer, it's exactly what I was looking for and it simplifies things a lot.

Not applicable