Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Result needed in front end

Hi,

I have a table

Order Order Type
Revenue
A130
A220
B130
B340
C350
C530
D240
E140

I want only those revenues which to be selected ,whose orders have order  type (1) or (1 and 2)

So resultant table should be

orders
order type revenueHeader 4
A130
A220
B130
E140

I want this table to be generated in front end not back end .

1 Solution

Accepted Solutions
Not applicable
Author

Hi Vikram,

Please use the below expression

Sum({<[Order Type]={1}>}Revenue) +

sum( {$<Order = P({<[Order Type]={1}>} Order),[Order Type]={2}>} Revenue)

View solution in original post

9 Replies
Michiel_QV_Fan
Specialist
Specialist

Use set analysis in your expression:

sum({<Order Type = {'1','2'}>}Revenue)

Not applicable
Author

Hi Michiel van de Goor,

I initially tried it  , but i am also getting order D  , which i dont want in the result since it doesnt qualify the criteria of 1 or (1 and 2) as  order type in a order

Michiel_QV_Fan
Specialist
Specialist

Why not in the back end? This could be solved more easily with group by statements.

Not applicable
Author

Yes i did it in back end for sample  , but issue is that the real  data model is huge ,complex  and messy built by someone else and i dont want to touch it . 

So i want to do it by front end . i know this can be done in front end as well ,but somehow not able to crack the nut

Michiel_QV_Fan
Specialist
Specialist

Sorry, can't help you with this one. Good luck

Not applicable
Author

Hi Vikram,

Please use the below expression

Sum({<[Order Type]={1}>}Revenue) +

sum( {$<Order = P({<[Order Type]={1}>} Order),[Order Type]={2}>} Revenue)

Anonymous
Not applicable
Author

Or without set:

if([Order Type]=1 or concat(total<Order> distinct [Order Type], '', [Order Type])=12, Revenue)

Anonymous
Not applicable
Author

Nandkishor Pandirkar:

Solution is good, just your set can be a little cleaner:

Sum({<[Order Type]={1}> + <Order = P({<[Order Type]={1}>} Order), [Order Type]={2}>} Revenue)

Not applicable
Author

thks