Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
There's a question with get before column value.
I have 2 dates, one is normal SNP date has mapping data. one is special date no data mapping.
I want get the expression1 value use to parameter for expression2. is that possible? how to do it?
see sample file.
Check this out:
Sum(Aggr(If([SNP Date]= Max(TOTAL <Country> [Cut off Date]), Value), Country, [SNP Date]))
Added another Country in the script:
load * inline [
Country, SNP Date, Cut off Date, Value
USA, 2016-03-01, ,21
USA, 2016-03-02, ,22
USA, 2016-03-03, ,23
USA, 2016-03-04, ,24
USA, ,2016-03-03,
USA, ,2016-03-02,
Canada, 2016-03-01, ,31
Canada, 2016-03-02, ,32
Canada, 2016-03-03, ,33
Canada, 2016-03-04, ,34
Canada, ,2016-03-02,
];
Output:
May be use this expression:
sum({<[SNP Date]={"$(=date(max([Cut off Date]),'YYYY-MM-DD'))"}>} Value)
thank you Sunny,
I add 2 country for data source, but looks the date not by Country, the expression2 just get the total max date of cut off Date, is there any way?
Check this out:
Sum(Aggr(If([SNP Date]= Max(TOTAL <Country> [Cut off Date]), Value), Country, [SNP Date]))
Added another Country in the script:
load * inline [
Country, SNP Date, Cut off Date, Value
USA, 2016-03-01, ,21
USA, 2016-03-02, ,22
USA, 2016-03-03, ,23
USA, 2016-03-04, ,24
USA, ,2016-03-03,
USA, ,2016-03-02,
Canada, 2016-03-01, ,31
Canada, 2016-03-02, ,32
Canada, 2016-03-03, ,33
Canada, 2016-03-04, ,34
Canada, ,2016-03-02,
];
Output:
se the new sample
Kevin Wen wrote:
se the new sample
Not sure what you mean
It works for me! Great help Sunny, thank you very much!