Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
In the Budgets dashboard which i am working the reports are concatenated with country name.Could you please suggest me the expression such that the appended country will be eliminated from the report name and i can get only the report name .
As the country names are with different number of words i am unable to guess the logic for this.
Ex:Algeria is one word country while United States of Great Britain is a 5 word country.Max we have only 5 words country.
Please find the attached documents.
Thanks in advance.
Regards,
Anu
Hi Anu,
You can use "MapSubString" function in this case.
Country:
Mapping LOAD
@1 as Countries,
'' as XYZ
FROM [Countries.txt]
(txt, codepage is 1252, no labels, delimiter is ',', msq);
Reports:
LOAD
@1 as Report,
Trim(MapSubString('Country',@1)) as Report_Name
FROM [budget reports.txt]
(txt, codepage is 1252, no labels, delimiter is ',', msq);
Output:
Hi,
on your script, use this to transform you field to have just the country name:
Trim(TextBetween(field_name,'Budget','')) as field_name
Hi Anu,
You can use "MapSubString" function in this case.
Country:
Mapping LOAD
@1 as Countries,
'' as XYZ
FROM [Countries.txt]
(txt, codepage is 1252, no labels, delimiter is ',', msq);
Reports:
LOAD
@1 as Report,
Trim(MapSubString('Country',@1)) as Report_Name
FROM [budget reports.txt]
(txt, codepage is 1252, no labels, delimiter is ',', msq);
Output:
Thank you Youssef.
Thank you so much Nagaraj. It is my perfect required one.
No problem Anu. Have a fantastic day.
Thank you.Same to you 🙂