cancel
Showing results for 
Search instead for 
Did you mean: 

Create Variable to sum measure for dimension with matching values

703

I have a report that pulls the Item Description, Quantities and Group Description:

Item Description Quantity Group Description

Blue Sweater Small 500 Blue Sweater

Blue Sweater Medium 750 Blue Sweater

Red Sweater Large 900 Red Sweater

Red Sweater X-Large 500 Red Sweater

I'm looking to add a fourth column that calculates the total quantity of each Group Description (see example below). I'm able to do this using SUMIFS after downloading the report to a spreadsheet but I need the calculation to happen in the report. I've been trying to create a Variable that calculate the Group Quantity but so far I haven't been able to find works. Does anybody have an idea how to get this done? Thanks in advance.

Item Description Quantity Group Description Group Quantity

Blue Sweater Small 500 Blue Sweater 1250

Blue Sweater Medium 750 Blue Sweater 1250

Red Sweater Large 900 Red Sweater 1400

Red Sweater X-Large 500 Red Sweater 1400

Accepted Solutions (1)

Accepted Solutions (1)

krisa24
Participant
0 Kudos

This should do a job:

=Sum([Quantity]) In ([Group Description])

Thanks Kristina, that did it!

Answers (2)

Answers (2)

zeshanshafqat79
Active Participant

Hello Nicolas,

Create a 2 variable name ABC and GHJ their type measure in webi.

use variable ABC formula 1 =sum(Quantities) where (XYZ ="Blue Sweater")

use variable GHJ formula 2 = sum(Quantities) where (XYZ ="Red Sweater")

after the formula is created then insert a new column on the right side then create a formula

=if(XYZ ="Blue Sweater") then (ABC) Else (GHJ)

0 Kudos

Hi Zeshan,

I was so focussed on simplifying my example that I forgot to mentions that the query generates thousands of Item Descriptions within hundreds of Group Descriptions which are continuously changing. This makes it impossible to create a variable for each Group Description as suggested. This is where I'm stumbling.

it is possible to make backed edition by making demension to measure