Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
when i try to create flag for the max date its not creating for the situation of same multiple date and same key
can i ksolve this issue
KEY | DATE | AMT | YEAR_FLAG | Year |
key1 | 06012016 | 100 | 2016 | |
key1 | 06012016 | 200 | 2016 |
can any one reply me to my query
Please Post your expression you are trying to create the Flag with.
also you need to reformat your date field
Hi!
How are you trying to create the flag?
Please elaborate more in order to be more helpful.
Kind regards,
FACT:
KEY,
DATE,
AMT
FROM
XXXX;
YEAR:
LOAD
Distinct
FirstSortedValue(KEY,-DATE) as KEY,
date(Max(DATE),'YYYY') as YEAR,
'Y' as YEAR_FLAG
Resident FACT
Group By KEY
;
now in the chart if i use the expression as
expression 1:
if(GetSelectedCount(Year)>=1,sum({< YEAR_FLAG={'Y'}>}AMT)
expresion2:
if(GetSelectedCount(Year)>=1,count({< YEAR_FLAG={'Y'}>}KEY)
can any one reply me
Hi,
what is your expected output??
Regards
Hi,
Are you looking for below output
There might be multiple solution one of it below
Test:
LOAD * INLINE [
Key, Date, Amt , Year
key1, 06012016, 100, 2016
key1, 06012016, 200, 2016
key2, 06022016, 200, 2016
];
join
Load Key as Key,
Date as Date,
max(Amt) as Amt,
Year as Year,
'maxFlag' as Flag
Resident Test
group by Key,Date,Year;
Regards,
Prashant