Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
johndoub
New 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
Employee
Employee

Re: calculated measure

See solution attached

calcmeas.PNG

johndoub
New Contributor III

Re: calculated measure

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
New Contributor III

Re: calculated measure

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