Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get Delta between two selections in the same field

Hi,

I'm quite a beginner with Qlikview and really hope you'll be able to help me

I have a set of data, i.e. sold products for one field, and dates for another one :

ProductDate

P1

2017-12-19
P22017-12-19
P32017-12-19
P12017-12-20
P32017-12-20

So, in QV I have to boxes, the first one with the products, the other one with de dates.

My problem:

I want to select two dates and display which product were sold during the first date but not during the second.

With the example table above, the result should be "P2" (sold the 2017-12-19 but not during the 2017-12-20).

Is it possible to achieve this with QV ? And, can somebody can help me with this ?

Thanks a lot by advance!

Nicolas

3 Replies
sunny_talwar

May be like this

=Concat(DISTINCT {<Product = {"=Count(Distinct Date) = 1"}>} Product)

Capture.PNG

Anonymous
Not applicable
Author

Hi Sunny,

Thanks a lot for your help. It works fine.

But my example was incomplete, sorry.

Actually, It doesn't work with more dates and products.

For example (limited with 3 dates and 4 products, but there can be more), with Table:

LOAD * INLINE [

    Product, Date   

    P1, 2017-12-18

    P4, 2017-12-18

    P1, 2017-12-19

    P2, 2017-12-19

    P3, 2017-12-19

    P1, 2017-12-20

    P3, 2017-12-20

];

If I select the two first dates, I expect to get 'P4' in the text box, but in fact it displays 'P2P3P4' (P2 and P3 being associated to the third date).

Do you think that it's possible to do it with QV ?

Thanks again.

Nicolas

sunny_talwar

I think your data is like this

Table:

LOAD * INLINE [

    Product, Date

    P1, 2017-12-18

    P4, 2017-12-18

    P1, 2017-12-19

    P2, 2017-12-19

    P3, 2017-12-19

    P2, 2017-12-20

    P3, 2017-12-20

];

Try this

=Concat(DISTINCT {<Product = {"=Count(Distinct {<Date>} Date) = 1"}>} Product)