Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need help comparing a date with a range of dates with a funtion, for example:
Date_A = March-2022
Range_Date = February-2022 March-2022 April-2022
If it matches it should show a value and if not another.
Could you help me please?
Thank you and regards,
please post some sample data
temp:
Load *,SubStringCount(RangeDate,DateA) , index(RangeDate,DateA) Inline [
RangeDate,DateA
February-2022 March-2022 April-2022,March-2022
];
you could either use SubStringCount() or Index() for this
if( SubstringCount('March-2022','February-2022 March-2022 April-2022') , then ,else)
or
if(Index('February-2022 March-2022 April-2022','March-2022'), then, else)
This it doesn't work for me... I think the problem is that the data is in variables, Date A is a 1 variable and Range_Date is another variable, they are not manual strings.
This Works though!; please post your actual script
let DateA = 'March-2022';
let RangeDate = 'February-2022 March-2022 April-2022';
let substrA= SubStringCount('$(RangeDate)','$(DateA)');
let indexA= index('$(RangeDate)','$(DateA)');
substrA is set to 1; <--occurences
indexA is set to 15 ;<--position in string
Surely I have a mistake...I'm new to this...
for example: SubStringCount([#RANGE_DATE],[#DATE_A]) it's fields not variables sorry
please post some sample data
temp:
Load *,SubStringCount(RangeDate,DateA) , index(RangeDate,DateA) Inline [
RangeDate,DateA
February-2022 March-2022 April-2022,March-2022
];