Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mbanerjee95
New Contributor

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
Valued Contributor

Re: Question about loading data

[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??

18 Replies
aarkay29
Valued Contributor

Re: Question about loading data

Load

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

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

From ExcelTable;

mbanerjee95
New Contributor

Re: Question about loading data

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

Re: Question about loading data

Remove the line

    

[Country]

aarkay29
Valued Contributor

Re: Question about loading data

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

mbanerjee95
New Contributor

Re: Question about loading data

[TOTAL SHIPMENTS]:

LOAD [Shipment Quantity In BUM],

[Country]

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

(ooxml, embedded labels, table is Sheet0);

dberkesacn
Contributor III

Re: Question about loading data

hi, comma is missing after Country field.

mbanerjee95
New Contributor

Re: Question about loading data

Hello,

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

capture3.PNG

dberkesacn
Contributor III

Re: Question about loading data

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
Valued Contributor

Re: Question about loading data

[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);