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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Set analysis with If statement

I have below data set

CountryCitySales
USANweYork2000
USA520
UKLondon200
UK150
AUSSydney8000
AUSperth560
USAChicago

580

I want to get

   

CountryCity Salesempty City Sales
USA2580520
UK200150
AUS8560

-

From Above data set. I use Country as dimension. and use separate set expressions for others. but i don't know how to get both the fields with and without country in single raw in pivot table

Thanks

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

You can get your output without If statement. Please take a look at the attached file and hope this helps....

Set analysis with If statement.jpg

View solution in original post

11 Replies
varshavig12
Specialist
Specialist

f - sum({<City={''}>}Sales)

empty - sum({<City-={''}>}Sales)

trdandamudi
Master II
Master II

You can get your output without If statement. Please take a look at the attached file and hope this helps....

Set analysis with If statement.jpg

Anonymous
Not applicable

Hi Anuradha,

Use following..

Dimension:- Country

Expression1:- City Sales-- Sum({<City={"=Len(City)>0"}>} Sales)

Expression2:- empty City -- Sum({<City={"=Len(City)=0"}>} Sales)

above formula will give you following output.

CountryCity Salesempty City
USA2580520
UK200150
AUS85600

Thanks,

punitpopli
Specialist
Specialist

You can also use 2 expression like below :

for Empty City sales : =sum({<City={""}>}Sales)

and for City sales : =sum({<City-={""}>}Sales)

Hope this helps!

Not applicable

It's not open in qlikview application thiru

Not applicable

Hi Punit,

In my qv "-=" won't work. Can you send qvd file.

sasiparupudi1
Master III
Master III

sum({<City={"=Len(City)>0"}>}Sales)

sum({<City={"=Len(City)=0"}>}Sales)

Not applicable

Super Sasi, it's working well

avinashelite

Try like this

City sales: sum({<City={'*'}>}Sales)

Empty city sales : sum({<City-={'*'}>}Sales) or sum({<City={''}>}Sales)