Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
April1234
Contributor II
Contributor II

Finding issue to get common id's between two years and calculate the count using p()

I am trying to find the count of common id's from two years using P(), but it shows issue with the calculation

using the calculation like this ,Count({<ID=p({<year={'2022'}>})>*p({<year={'2023'}>})>}distinct ID)

But issue here is , it shows increase in values initially in a table with all the locations specified but shows correctly when a particular location is selected.

Any help here to fix the logic to show same numbers with or without selection of location?

Thank you!

 

 

Labels (2)
1 Solution

Accepted Solutions
MatheusC
Specialist
Specialist

@April1234 
try this:

Count({<year={'2022'},ID=P({<year={'2023'}>}ID)>}distinct ID)


Regarts, Matheus 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

2 Replies
MatheusC
Specialist
Specialist

@April1234 
try this:

Count({<year={'2022'},ID=P({<year={'2023'}>}ID)>}distinct ID)


Regarts, Matheus 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
April1234
Contributor II
Contributor II
Author

It is very close to the numbers . I gave a try swapping the numbers and it worked. 

Count({<year={'2023'},ID=P({<year={'2022'}>}ID)>}distinct ID)   

 Thank you so much Matheus for the logic.