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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

DATA Update

i want to load data for Domain ,SubDomain,Visit

1.for Domain i want to load only those rows which is not eqal to total .

2.for SubDomain i want to load rows which is not equal to total but if count of Domain is equal to 1 then i also need to load total for that row .

is there any way to do this.

Sample data:

DomainSubDomainVisit
abcabc110
abcabc110
abcabc110
abcabc110
abctotal50
xyztotal20
ghjghj130
ghjghj130
ghjghj130
ghjghj130
ghjtotal120
jkltotal80
totaltotal430

Load table should be like as:

DomainSubDomainVisit
abcabc110
abcabc110
abcabc110
abcabc110



xyztotal20
ghjghj130
ghjghj130
ghjghj130
ghjghj130



jkltotal80
1 Solution

Accepted Solutions
Not applicable
Author

try this:

test:

LOAD * INLINE [

    Domain, SubDomain, Visit

    abc, abc1, 10

    abc, abc1, 10

    abc, abc1, 10

    abc, abc1, 10

    abc, total, 50

    xyz, total, 20

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, total, 120

    jkl, total, 80

    total, total, 430

];

test2:

load Domain,  count(Visit) as Counter resident test group by Domain;

left join (test) load * resident test2;

drop table test2;

final:

load Domain, SubDomain, Visit resident test where SubDomain<> 'total' or Counter=1 and Domain <>'total';

drop table test;

View solution in original post

2 Replies
Not applicable
Author

try this:

test:

LOAD * INLINE [

    Domain, SubDomain, Visit

    abc, abc1, 10

    abc, abc1, 10

    abc, abc1, 10

    abc, abc1, 10

    abc, total, 50

    xyz, total, 20

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, ghj1, 30

    ghj, total, 120

    jkl, total, 80

    total, total, 430

];

test2:

load Domain,  count(Visit) as Counter resident test group by Domain;

left join (test) load * resident test2;

drop table test2;

final:

load Domain, SubDomain, Visit resident test where SubDomain<> 'total' or Counter=1 and Domain <>'total';

drop table test;

jvitantonio
Specialist III
Specialist III

Hi, you can also do it directly in the pivot table. Check out the app.