Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I've a requirement to exclude Years from the Chart.
Although, my actual logic is very complex which I'm using in my Application but I created a sample to take help from you guys.
Here is the sample data:
LOAD * INLINE [
Year_Name, Flag
2022-02, NA
2022-01, NA
2021-12, NA
2021-11, NA
2021-10, NA
2021-09, A
2021-08, A
2021-07, A
2021-06, A
2021-05, A
];
Anyhow, I've to use concat in match condition in order to achieve the result but it's not working in my case.
I think I have to aggregate my expression again with using Concat & Aggr.
PFB the desired output snapshot:
Regards,
Eric
I think the trick to get your expression to work like you seem to expect would be to let the concat() function not only create a single string that is compared against the Year_Name values, but instead let it define the distinct match values itself. This can be done by dollar sign expanding the concat expression:
I.e. in your case like this:
=IF(NOT MATCH(Year_Name,$(=CONCAT({<Flag={'NA'}>}CHR(39)&Year_Name&CHR(39),','))),Year_Name)
That being said, I do agree with Rob in that there surely are shorter, easier and faster (set expression) solutions than this, however complex your use case might be.
hope this helps
Marco
How about:
Only({<Flag={'A'}>} Year_Name)
-Rob
if there will be other values for Flag , you can try this
If(Flag<>'NA',Year_Name)
Hi Sir,
Thanks for taking time and answering to my question.
But as I said above my actual logic is bit complex so,
I want t to generate result using something like this which are not matching:
=IF(NOT MATCH(Year_Name,CONCAT({<Flag={'NA'}>}CHR(39)&Year_Name&CHR(39),',')),Year_Name)
Hope I added some clarity here.
-Eric
I think the trick to get your expression to work like you seem to expect would be to let the concat() function not only create a single string that is compared against the Year_Name values, but instead let it define the distinct match values itself. This can be done by dollar sign expanding the concat expression:
I.e. in your case like this:
=IF(NOT MATCH(Year_Name,$(=CONCAT({<Flag={'NA'}>}CHR(39)&Year_Name&CHR(39),','))),Year_Name)
That being said, I do agree with Rob in that there surely are shorter, easier and faster (set expression) solutions than this, however complex your use case might be.
hope this helps
Marco
Hi @MarcoWedel
I agree that @rwunderlich logic is shorter and easier but I guess it will not work in my case.
My requirement is to exclude cases which is inside Concat() function.
- Eric