Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Question about loading data

Hello all,

I am currently working on a Qlik visualization that utilizes about 800 rows of data regarding shipments to African countries. I am planning on creating a pie chart to show the different ratios. However, my other graphs in the dashboard have countries such as Sierra Leone and Guinea written completely whereas this new Excel data sheet with the 800 rows has them labeled "sl" and "gn" in each individual. As it would be both extraneous and tedious to go row-by-row changing the names of each country, I was wondering if there was any easier way to do this. I will attach a picture below of my current dashboard for more insight. I appreciate any help and thanks again!

Sincerely,

Munna

qlikebola.PNG

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

[TOTAL SHIPMENTS]:

LOAD [Shipment Quantity In BUM],

  If(WildMatch(Country,'sl*'),'Sierra Leone',

      If( WildMatch(Country,'gn*'),'Guinea','Liberia')) as Country

FROM [lib://Downloads/dr-ebolashipments-materiallineitems-07222014to12312014.xlsx]

(ooxml, embedded labels, table is Sheet0);

Did This Work For You??

View solution in original post

18 Replies
aarkay29
Specialist
Specialist

Load

If(WildMatch(Country,'sl*'),'Sierra Leone',

     If(WildMatch(Country,'gn*'),'Guinea'),'Liberia') as Country

From ExcelTable;

Anonymous
Not applicable
Author

Thank you for your suggestion, however, I am still getting an error when I tried inserting that code into the data load editor. I'm attaching a screenshot as well. bigerror.PNG

Anonymous
Not applicable
Author

Remove the line

    

[Country]

aarkay29
Specialist
Specialist

Hi Debashish,

I just gave you the sample code you must be very new to Qlik

Can You please post the script you had earlier then I would make the changes and will post back

Anonymous
Not applicable
Author

[TOTAL SHIPMENTS]:

LOAD [Shipment Quantity In BUM],

[Country]

FROM [lib://Downloads/dr-ebolashipments-materiallineitems-07222014to12312014.xlsx]

(ooxml, embedded labels, table is Sheet0);

dberkesacn
Partner - Creator III
Partner - Creator III

hi, comma is missing after Country field.

Anonymous
Not applicable
Author

Hello,

I removed the [Country] line and added a comma afterwards. However, I am still getting an error.

capture3.PNG

dberkesacn
Partner - Creator III
Partner - Creator III

Hi,

you used bracket in a wrong position:

Try this:

    If(WildMatch(Country,'sl*'),'Sierra Leone',

      If( WildMatch(Country,'gn*'),'Guinea','Liberia') as Country

aarkay29
Specialist
Specialist

[TOTAL SHIPMENTS]:

LOAD [Shipment Quantity In BUM],

  If(WildMatch(Country,'sl*'),'Sierra Leone',

      If( WildMatch(Country,'gn*'),'Guinea','Liberia')) as Country

FROM [lib://Downloads/dr-ebolashipments-materiallineitems-07222014to12312014.xlsx]

(ooxml, embedded labels, table is Sheet0);