Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shamsu_mk
Creator
Creator

Grouping data (Not Field) with formula

Hello

I have some data s example mentioned below table

Ac          Amount          BC

1               6000               CA

2               3000               CL

3               2000               CA

4               4000               CL

I need to calculate "CR" with the following formula

CR= sum( CA) / Sum(CL)

Thanks

Shamsu

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum({<BC = {'CA'}>}Amount)/Sum({<BC = {'CL'}>}Amount)

View solution in original post

5 Replies
sunny_talwar

May be this

Sum({<BC = {'CA'}>}Amount)/Sum({<BC = {'CL'}>}Amount)

shamsu_mk
Creator
Creator
Author

Thank you, it worked properly

shamsu_mk
Creator
Creator
Author

Hi

I need an additional support on the above query

I have a QlikView report as mentioned below.The column "change"  shows the cumulative variance.

For example Change in CA, The value for May was 68 and June is 69. so the variance is 1

The script used calculate this as If(RowNo(TOTAL) = 1, 0, RangeSum([CA] - Above(TOTAL [CA])))    

Since the script depends on the Rows I can not apply this expression in the chart.

I need a chart to show the change in Ca and Change in CL. Please help me.

        

YearMonthCAChange in CAVar. %CLChange in CLVar. %
2014Jan720-420-
2014Feb67-6-8%36-7-16%
2014Mar63-3-5%43822%
2014Apr62-2-2%4524%
2014May68610%551023%
2014Jun6912%5723%
2014Jul65-4-5%56-2-3%
2014Aug58-8-12%51-5-9%
2014Sep54-3-6%46-5-10%
2014Oct5623%4500%
2014Nov5824%4938%
2014Dec893154%31-18-37%

Thanks

Shamsu

sunny_talwar

Would you be able to share a qvw sample to show the issue?

shamsu_mk
Creator
Creator
Author

Hi

Yes, I will send.