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: 
reivax31
Partner - Creator III
Partner - Creator III

Count number of old/new ID

Hi Qlikers,

I would like to calculate how many old/new ID I have between two dates. What I tried is :

count(distinct(if(Extract_Date = 'MAX DATE', ID)) - count(distinct(if(Extract_Date = 'MIN DATE', ID)) . But this doesn't work for a table like this :


  

MIN DATEAcount(distinct(if(Extract_Date = MIN 'DATE', ID)) = 8
MIN DATEB
MIN DATEC
MIN DATED
MIN DATEE
MIN DATEF
MIN DATEG
MIN DATEH
MAX DATEAcount(distinct(if(Extract_Date = MAX 'DATE', ID)) = 6
MAX DATEB
MAX DATEC
MAX DATEI
MAX DATEJ
MAX DATEK

The result I would like is to find 5 old ID (D,E,F,G,H) in my MIN DATE and 3 new ID (I,J,K) in my MAX DATE. If someone has and idea without doing anything in the script. Just in the visualisation console.

Thanks for your help

14 Replies
sunny_talwar

Currently I don't, but are you located in the US?

reivax31
Partner - Creator III
Partner - Creator III
Author

Hi, I have one extrat question. how would you put the expression if I want to sum(sales) in the case that ID in new ?

I tried something like this but no success ...

sum(if(Count({<[ID] = p({<Extract_Date = {"$(=Date(Max(Extract_Date)))"}>})*e({<Extract_Date = {"$(=Date(Min(Extract_Date)))"}>})>}[ID])>0,[Sales])

reivax31
Partner - Creator III
Partner - Creator III
Author

We are located in South of France. If you come around let us know .

I think also I will ask Qlik partner if they have some local contacts.

sunny_talwar

Should be just this

=Sum({<ID = p({<Extract_Date = {"$(=Date(Min(Extract_Date)))"}>})*e({<Extract_Date = {"$(=Date(Max(Extract_Date)))"}>})>}Sales)


=Sum({<ID = p({<Extract_Date = {"$(=Date(Max(Extract_Date)))"}>})*e({<Extract_Date = {"$(=Date(Min(Extract_Date)))"}>})>}Sales)

reivax31
Partner - Creator III
Partner - Creator III
Author