Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have an requirement line the Below mentioned
This is my input
ACCOUNT_ID | PREVCLUSTER | CURRCLUSTER | START_DATE |
397394 | Negative | Neutral | 05/02/2016 |
235863 | Positive | Negative | 11/02/2016 |
316168 | Positive | Negative | 21/02/2016 |
316168 | Negative | Neutral | 08/03/2016 |
235863 | Negative | Neutral | 16/03/2016 |
397394 | Neutral | Positive | 21/03/2016 |
316168 | Neutral | Negative | 05/04/2016 |
397394 | Positive | Negative | 16/04/2016 |
235863 | Neutral | Positive | 05/05/2016 |
397394 | Negative | Neutral | 11/05/2016 |
316168 | Negative | Neutral | 21/05/2016 |
I want out put like below mentioned
ACCOUNT_IDPREVCLUSTER CURRENT CLUSTER
397394,Negative,Neutral
235863,Positive,Positive
316168,Positive,Neutral
This out put should Dynamic based on user selection on months
it should be any random month selection also
Thanks,
Ram
Is it that you want months on dashboard for filtering the data?
Yes your correct
if user select month_year
every account we need to take min date status and max status status
and need to compare
ACCOUNT_IDPREVCLUSTER CURRENT CLUSTER
397394,Negative,Neutral
235863,Positive,Positive
316168,Positive,Neutral
What is the selection here?
That does not work in this senario
Because if you bring this status from back end it should be static
But i want Dynamic change
316168 | Negative | Neutral | 08/03/2016 |
235863 | Negative | Neutral | 16/03/2016 |
397394 | Neutral | Positive | 21/03/2016 |
316168 | Neutral | Negative | 05/04/2016 |
397394 | Positive | Negative | 16/04/2016 |
235863 | Neutral | Positive | 05/05/2016 |
if user select mar to may
then status need to change
Month
user may be select multiple months
Looks like you didn't understand my question.
You have given sample data and also given and output..
We want to understand that this output is based on what selection?
i.e. What is the selection user will do and what is the output you are looking?
Provide logic behind your requirements.
here month is the selection
The Requirement behind this
assume
i have 100 accounts
for every account there is a moment like from date to to date like i mentioned above
The logic i have written here
vFirstcluster=Only({<START_DATE={'$(=min(START_DATE))'}>}PREVCLUSTER)
vEndingCluster=Only({<START_DATE={'$(=max(START_DATE))'}>}CURRCLUSTER)
VNatureofchange=if(vStartingCluster='Negative' and vEndingCluster='Neutral' or
vStartingCluster='Neutral' and vEndingCluster='Positive' or
vStartingCluster='Negative' and vEndingCluster='Positive' ,1,
if(vStartingCluster='Positive' and vEndingCluster='Neutral' or
vStartingCluster='Positive' and vEndingCluster='Negative' or
vStartingCluster='Neutral' and vEndingCluster='Negative' ,-1,0))
now what is happening here if i select jan feb and mar it is taking min cluster and max cluster and it is applying for all metrics
but that is not right other metrics have different cluster
Thanks