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

expression referring to other dimension field

Dear all,

Please suggest how to implement in the following case .

Dimension: VIP Issue Store

expression 1: sum of VIP salse

expression 2: sum of all sales  include vipsales  where Purchase store = issuestore )

layout:

Issue store |  expression 1  |  expression 2

A               | sum( sales )    |   sum(total { $<Purchase store = Issue store > } Sales )

Please suggest the appropriate expression for expression2 T^T

Many Thanks !!

Calvin Lin

4 Replies
Not applicable
Author

Hello,

How are you identifying that your sales are VIP or not.

The first expression must return sum of VIP sales, but the expression u are using will return all sales.

You can use something like below:

exp 1: sum({<SaleType = {"VIP"}>}sales)

exp 2: sum(if(Purchase store = issuestore, sales,0))

Thanks,

Angad

manideep78
Partner - Specialist
Partner - Specialist

Try this

Sum({<[Purchase store}={'Issue store'}, [Issue store]={'VIP'}>}TOTAL Sales)

Not applicable
Author

Dear Angad,

for exp 2, your suggestion is returning sales of some vip that the issuestore  is equal to the purchase store,

what if i just want the sales of all sales that the purchase store equals to the dimension in the table - issue store?

because there may exist some sales which are not made by VIP,

thus, the records do not have an issue store... 

in that case, the records will be ommited...  

Not applicable
Author

Hello Calvin,

May be I have not understood your requirement well, but can you please try below expression:

if(Purchase store = issuestore, sum(sales),0)


Is it possible, for you to attach your qvw file or give us dummy data with expected results.


Thanks,

Angad