Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 DATE | A | count(distinct(if(Extract_Date = MIN 'DATE', ID)) = 8 |
MIN DATE | B | |
MIN DATE | C | |
MIN DATE | D | |
MIN DATE | E | |
MIN DATE | F | |
MIN DATE | G | |
MIN DATE | H | |
MAX DATE | A | count(distinct(if(Extract_Date = MAX 'DATE', ID)) = 6 |
MAX DATE | B | |
MAX DATE | C | |
MAX DATE | I | |
MAX DATE | J | |
MAX DATE | K |
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
Currently I don't, but are you located in the US?
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])
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.
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)