Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can you help on to get only below required comment to display in "Text and Image" box in QS based on Max(Flag ) and Min(Date).
Load * Inline [
Flag,Date,Comment
0,'01/01/2019',comment1
0,'01/02/2019',comment2
0,'01/03/2019',comment3
1,'01/04/2019',comment4
1,'01/05/2019',comment5
1,'01/06/2019',comment6
1,'01/07/2019',comment7
];
date format: MM/DD/YYYY
Expected result:
comment4
Trying with :
Only({< Date = {"$(=Min(Date))"},Flag={1} >} Comment)
Thanks for your quick help.
May be this
Only({<Date = {"$(=Date(Min({<Flag={1}>}Date), 'MM/DD/YYYY'))"}, Flag={1}>} Comment)
Hi,
not working if we have 2 conditions.
But ok for 1 condition.
Only({< Date = {'$(=MinString(Date))'} >} Comment)
I understand, but max(date) min(flag) can be intepreted in at least three ways.
=only({<
Flag = {$(=max(Flag))},
Date = {'$(=minstring({<Flag = {$(=max(Flag))}>}Date))'}
>} Comment)
=only({<
Flag = {$(=max({<Date = {'$(=minstring(Date))'}>}Flag))},
Date = {'$(=minstring(Date))'}
>} Comment)
=Only({<
Comment = P({<Flag={'$(=max(Flag))'},Date={'$(=MinString(Date))'}>})
>} Comment)
Using this data:
Load * Inline [
Flag,Date,Comment
0,'01/01/2019',comment1
0,'01/02/2019',comment2
0,'01/03/2019',comment3
1,'01/04/2019',comment4
1,'01/05/2019',comment5
1,'01/06/2019',comment6
1,'01/07/2019',comment7
];
Other way, it should look for min date and flag=1
In your example minimum date is '01/01/2019' and combined with flag=1 you wont get any hits. So the expression will return null().
Which comment number are you expecting from your data set?
May be this
Only({<Date = {"$(=Date(Min({<Flag={1}>}Date), 'MM/DD/YYYY'))"}, Flag={1}>} Comment)
Thanks Sunny, its working like charm.