9 Replies Latest reply on Jul 18, 2018 12:05 AM by Mahfooj Khan

# Count Net sales

HI Guys,  i already make a calculation to count sales current year. But there's a request that the sales current year should be count based on parameter select ( mall/store ). So when user click the parameter and choose store, the table will only showing sales current year based on store and not by mall. how i can do the calculation for that?

• ###### 1. Re: Count Net sales

Create This Calc, Drag to Filter and SET TRUE

Otherwise you can do this:

IF Your Store field in your data=Select(Mall Store) Parameter THEN Net Sales Current Year ENd

Thanks

Deepak

• ###### 2. Re: Count Net sales

Hi Mr Deepak,

i can't using the calculation that you have suggest

is there the other advice to count net sales current year based on parameter ? because the parameter was integer so if they choose mall -> 1 and store -> 2

• ###### 3. Re: Count Net sales

In Your Data Code Create This Calc:

IF Store Type+"Mall" Then 1 Else 2 End

Then Compare this in your Previous Calc with Parameter

• ###### 4. Re: Count Net sales

Dear Mr Deepak,

i still can't calculate it, i attach the sampel data. can you help me to create the calculation?

Thank You,

Regards.

• ###### 5. Re: Count Net sales

Pl create a .twbx using your data as You have one column without Header, so Pl Create something and I will help, if you get stuck.

Thanks

Deepak

• ###### 6. Re: Count Net sales

Mr Deepak, what's PI ?

• ###### 8. Re: Count Net sales

Dear Mr Deepak,

here's the twbx

Thank You.

• ###### 9. Re: Count Net sales

Hi Welly,

As per the data you've two different fields (Mall and Store Name) and you've created an integer parameter (Select ( Mall / Store )) having values (1=Mall and 2=Store). I'm assuming that you'd like to see the Net Sales Value based on selection of parameter. Like if we select not null values from Mall dimension then total net sales which is 21,279. In case of Store Name there is one null values and I think you'd like to exclude in your total net sales so result should be 21,245. Correct me if I'm wrong.

Here is my approach,

Write a case statement to call the dimensions using parameter. It'll refer respective dimension while selection.

[Mall / Store Dimension]:

CASE [Select ( Mall / Store )]

WHEN 1 THEN [Mall]

WHEN 2 THEN [Store Name]

END

Now using the above calculated field we'll get the Net Sales like this. NOT ISNULL() function will exclude the null values from the list of your dimensions.

[Values]:

IF NOT ISNULL([Mall / Store Dimension]) THEN [Net Sales Current Year] END

See the output,

Mall

Store:

Workbook attached for your reference. Let us know if this help.

Mahfooj

1 of 1 people found this helpful