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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

How two expressions could be applied in set expression with < along with other dimention!

I need following conditions to be satisfied through a set expression

Dimensions

PRD_CODE

BRANCH

EXPRESSIONS

GROSS PREMIUM

NET PREMIUM

I wrote the set expression as follows!

SUM({<PRD_CODE={'KK','PP'},BRANCH={'RA'}, GROSS PREMIUM={">NET PREMIUM"}>} SALES)

I require when PRD_CODE=kk,pp, and Branch = RA, GROSS PREMIUM > NET PREMIUM, the sales!

Please see the error & the place

Thanks for early reply

Neville

1 Solution

Accepted Solutions
Anil_Babu_Samineni

I always prefer to create in script like

If(gross>net, 1,0) as flag then in Set analysis you can write flag ={1}

Or else try this

SUM({<PRD_CODE={'KK','PP'},BRANCH={'RA'}, GROSS PREMIUM={"= GROSSPREMIUM >NET PREMIUM"}>} SALES)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni

I always prefer to create in script like

If(gross>net, 1,0) as flag then in Set analysis you can write flag ={1}

Or else try this

SUM({<PRD_CODE={'KK','PP'},BRANCH={'RA'}, GROSS PREMIUM={"= GROSSPREMIUM >NET PREMIUM"}>} SALES)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
lironbaram
Partner - Master III
Partner - Master III

hi

because set analysis is like making selection in the app

your last condition isn't going to work

you'll need something like

SUM({<PRD_CODE={'KK','PP'},BRANCH={'RA'}>} if(GROSS PREMIUM>NET PREMIUM,SALES))

this expressions assumes that gross premium and net premium are values in a record and not aggregation functions