Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
johndoub
Contributor III
Contributor III

calculated measure

my data record has the following fields:

Date, TranId, Item, DiscountType, NetAmt 

10/1/19, 12345, dress, 20%promo,100.00

10/1/19, 12345, sweater, -(no discount), 75.00

10/1/19, 12345, top, -(no discount), 50.00

i would like to show the total Sum(NetAmt) of the transaction if one of the items has a specific DiscountType.

in the above example, this would be 225.00 for the 20%promo discount type.

how should i write the expression for a measure that would show this?

thanks.

john doub

 

3 Replies
Lisa_P
Employee
Employee

See solution attached

calcmeas.PNG

johndoub
Contributor III
Contributor III
Author

thanks for your help on this.

i should have been clearer with my question.

as an example,my data record has the following fields for 3 transactions

Date, TranId, Item, DiscountType, NetAmt 

10/1/19, 12345, dress, 20%promo,100.00

10/1/19, 12345, sweater, -(no discount), 75.00

10/1/19, 12345, top, -(no discount), 50.00

(total for tran 12345 =225)

10/1/19, 12346, sweater, Fallpromo, 80.00

(total for tran 12346 =80)

10/1/19, 12347, sweater, -(no discount), 60.00

10/1/19, 12347, dress, 20%promo, 80.00

(total for tran 12347 = 140)

i would like to show the total Sum(NetAmt) for the transactions where the 20%promo discount type was used.

in the above example, transactions 12345 and 12347 would qualify since one of the items in each of these transactions used the 20%promo discount type.

therefore, the sum(NetAmt) would be 225 +140 = 265

how should i write the expression for a measure that would show this?

thanks.

john doub

johndoub
Contributor III
Contributor III
Author

correction total for sum(NetAmt) should be 220+145=365