Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ak00428233
Contributor III
Contributor III

Regarding elimination of the country name from report name

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

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

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:

Capture.PNG

View solution in original post

6 Replies
YoussefBelloum
Champion
Champion

Hi,

on your script, use this to transform you field to have just the country name:

Trim(TextBetween(field_name,'Budget','')) as field_name

tamilarasu
Champion
Champion

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:

Capture.PNG

ak00428233
Contributor III
Contributor III
Author

Thank you Youssef.

ak00428233
Contributor III
Contributor III
Author

Thank you so much Nagaraj. It is my perfect required one.

tamilarasu
Champion
Champion

No problem Anu. Have a fantastic day.

ak00428233
Contributor III
Contributor III
Author

Thank you.Same to you 🙂