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: 
Anonymous
Not applicable

Create flag with excluded value

Good day!

In my test model i have simple table:

Main:

load

City

from

City.xlsx

(ooxml, embedded labels, table is Sheet1);

 

City
City1
City2
City3
City4
City5
City6
City7

I need to create some flag in load script, which will have such values:

1. All cities - in this case it will filter all cities

2. w/o third - in this case it must exclude value City3

Thanks.

1 Solution

Accepted Solutions
Kushal_Chawda

Try something like this

Main:

LOAD City

FROM

City.xlsx

(ooxml, embedded labels, table is Sheet1);

Final:

load *,

'All Cities' as Flag

Resident Main;

Concatenate (Final)

load *, 'w/0 third' as Flag

Resident Main

where City<>'City3'

order by City;

DROP Table Main;

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I need to create some flag in load script, which will have such values:

1. All cities - in this case it will filter all cities

2. w/o third - in this case it must exclude value City3

I don't understand what you're trying to do. Why do you need a flag field? Why not simply let the user select the cities or use bookmarks?


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

test:

load

  City

from

City.xlsx

(ooxml, embedded labels, table is Sheet1);

Final:

Load RowNo() as No, City Resident test Order By City;

Left Join (Final)

Load City, '1' as Flag1 Resident test;

Left Join (Final)

Load City, '2' as Flag2 Resident Final Where No <> 3 Order By City;

Drop Table test;

Kushal_Chawda

Try something like this

Main:

LOAD City

FROM

City.xlsx

(ooxml, embedded labels, table is Sheet1);

Final:

load *,

'All Cities' as Flag

Resident Main;

Concatenate (Final)

load *, 'w/0 third' as Flag

Resident Main

where City<>'City3'

order by City;

DROP Table Main;

pratap6699
Creator
Creator

after load Where city<> 3 Order By City