Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need % calculation based on field total wise

Hi,

I  taken 3 dimensions and 6 expressions in pivot table.My requirement is to show the %calculation based on the field total wise it is in 1st dimension.

I taken expression is

sum({$<YEAR = {$(=max(YEAR))}, MONTH = {"<=$(=max({<YEAR={$(=max(YEAR))}>} MONTH))>$(=max({<YEAR={$(=max(YEAR))}>} MONTH)-1)"},ClosingStock={'>0'}>}  IF(AHC_CallDate = MAXDATE_CHECK, ClosingStockInCase))

it is showing correct value,but i want to show this value in %,based on the total of one field

ex:-  value=186.12, i want to divide this value with field total i.e.,35007.32

requirement= (186.12/35007.32)*100

                = 0.53%

i am having 4fiels in 1 dimension,i want to show this calculations for different values.

thanks,

ba

Labels (1)
3 Replies
swuehl
Champion III
Champion III

I first thought it should be enough to just use the TOTAL qualifier with field list to calculate the total, something like

=100*

sum({YOURSETANALYSIS} Value) / sum({YOURSETANALYSIS} TOTAL<FIRSTDIMENSIONFIELD> Value)

Then I noticed that you are using an if() clause to restrict your Value:

IF(AHC_CallDate = MAXDATE_CHECK, ClosingStockInCase)

Depending on your data model and dimensions used, this might complicate things a little, but to tell more, you would need to tell us a little more about your setting (or post a small sample app).

Not applicable
Author

You can use this code :

Sum({SET_ANALYSIS} VALUE) /

Aggr(NODISTINCT Sum({SET_ANALYSIS} VALUE), {YOUR_DIMENTION})

I use this code when i want to get % calculation in expression on Pivot or Straight table.

Not applicable
Author

Hello Danny,

Thanks for ur reply,tell me what information you want.i will give you.i am trying past from 4 days but solution is not coming.

regards,

ba