Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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.
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
Lemonade66

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.

1 Solution

Accepted Solutions
jsn
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

jsn
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)

Sokkorn
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

Re: Help filtering data

lakhina007, thank you for your answer, but it didn't work as I had in mind.

Community Browser