Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Load if there's a value

I have an excel sheet with 3 columns (containing text only): Category, PrimaryDomain, and SecondaryDomain.  Every Category has one or two domains, so PrimaryDomain always has a value, but SecondaryDomain only has a value sometimes.  I would like any calculations made in the Qlikview document associate a Category as having one or two Domains, but it's not loading right.  I'm trying to test it in a document with less data to test the theory.

Here's my test load statement:

LOAD Category,

     PrimaryDomain as Domain

FROM

(ooxml, embedded labels, table is Sheet1);

LOAD Category,

     If( IsText(SecondaryDomain), SecondaryDomain) as Domain

FROM

(ooxml, embedded labels, table is Sheet1);

On my test document which uses this script, Categories which only have one Domain are loading as if they have two values for Domain: the PrimaryDomain value and NULL.  (The test QVW is attached.)

Any suggestions on how to remove the NULL value and/or how to essentially two excel columns into one field with correct connections?

1 Solution

Accepted Solutions

Re: Load if there's a value

Try with this

LOAD Category,

     PrimaryDomain as Domain

FROM

(ooxml, embedded labels, table is Sheet1);

LOAD Category,

     SecondaryDomain as Domain

FROM

(ooxml, embedded labels, table is Sheet1)

WHERE Len(Trim(SecondaryDomain)) > 0;

2 Replies

Re: Load if there's a value

Try with this

LOAD Category,

     PrimaryDomain as Domain

FROM

(ooxml, embedded labels, table is Sheet1);

LOAD Category,

     SecondaryDomain as Domain

FROM

(ooxml, embedded labels, table is Sheet1)

WHERE Len(Trim(SecondaryDomain)) > 0;

Not applicable

Re: Load if there's a value

That did the trick!  Thanks

Community Browser