Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
maxime66
Creator
Creator

Count unique row that match with an inventory date

Hy Qlikers,

I would like to create an expression that only count the row in yellow in this screenshot. (and 0 for others) for each [num_affaire]

in the exemple i define a date_of_inventory = 31/08/2022 .

i can successfully define what rows can't  be in the inventory (stock =0) , but i can't go further and flag the yellow one.

stock=count(distinct if( floor(tache_date_heures) > date_of_inventory , null(),num_affaire))

maxime66_1-1729866281453.png

if someone can help me 🙂

 

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

@maxime66  try below

=count(DISTINCT aggr(if(
date_affaire= max(total <num_affaire>{<date_affaire={"<=$(=max(calendrier.date_dern_jour_mois))"}>}date_affaire),num_affaire),
num_affaire,date_affaire))

 

Kushal_Chawda_0-1729883431725.png

 

View solution in original post

10 Replies
Kushal_Chawda
MVP
MVP

@maxime66  Is the date of inventory hardcode value? 

maxime66
Creator
Creator
Author

Hello @Kushal_Chawda 

it's a date that can be filter in a indépendant calendar table.

Kushal_Chawda
MVP
MVP

@maxime66  try below expression

=aggr(if( floor(taches_date) > max(total date_of_inventory),0,1),num_affaire,taches_date,status)

maxime66
Creator
Creator
Author

Thank you so much , but something doesen't work . maybe more simple with the exemple below screenshot + qvw app ?!

maxime66_0-1729869923030.png

 

Kushal_Chawda
MVP
MVP

@maxime66  is this output you want?

Kushal_Chawda_0-1729870605232.png

 

maxime66
Creator
Creator
Author

actually it is this one 

 

maxime66_0-1729871200013.png

 

Kushal_Chawda
MVP
MVP

@maxime66  what is the logic to get that output?

maxime66
Creator
Creator
Author

We want to know the number of [num_affaire] by [Statut] at different selected inventory_date.

at 31/12/2023 I have 2 [num_affaires] and they are both in a "Stand by" [statut]...

Kushal_Chawda
MVP
MVP

@maxime66  try below

=count(DISTINCT aggr(if(
date_affaire= max(total <num_affaire>{<date_affaire={"<=$(=max(calendrier.date_dern_jour_mois))"}>}date_affaire),num_affaire),
num_affaire,date_affaire))

 

Kushal_Chawda_0-1729883431725.png