Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparative analysis with Alternate States

Hi everybody. It's the first time i wrote here.

I read many discussions but i didn't find the solutions.

I have this problem.

I have two different states (A and B) with selected years (2014, 2015).

The expressions to calculate active customers of a selected shop (nomeNegozio) in different years (2014 and 2015) are:

Count ({statoA<KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio>} DISTINCT KidCustomer)

Count ({statoB<KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio>} DISTINCT KidCustomer)

Now i would like to calculate customers that were active in 2014 but not in 2015. I tried many expressions but nothingI

Count({statoB-statoA <KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio>} DISTINCT KidCustomer)

or

Count({statoA <KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio>-statoB <KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio>} DISTINCT KidCustomer)

Anyone could help me please?

Thank you

R.

3 Replies
ramoncova06
Specialist III
Specialist III

do you define the year ?  by the selection ?

if that is true then try with this

Count ({statoA<KidTipoMov={2},TipoMovimento={INTERNI}, nomeNegozio=$::nomeNegozio, KidCustomer =e ({statoB})>} DISTINCT KidCustomer)

Not applicable
Author

Perfetct!! Thankyou.

I don't really understand the syntax but it runs...

ramoncova06
Specialist III
Specialist III

glad it worked, since you states worked based on selections the KidCustomer =e ({statoB}) is telling it to exclude every possible value that is part of the selection in startoB