Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
CELAMBARASAN
Partner - Champion
Partner - Champion

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;

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

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
Author

That did the trick!  Thanks