on 03-05-2018 7:43 AM
Hello All,
I have prepared crosstab report in Crystal Report 2013 as shown below and get year difference using calculate columns fields. But year difference not appeared when i change the input parameter and select other year. I need help to create calculated columns dynamically.
Report Criteria
Report Output
I used to below code in calculated columns to show year difference
Difference b/w 15 & 16
if GetColumnPathIndexOf({?Year}-3)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-3), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-2), CurrentSummaryIndex))
Difference b/w 15 & 17
if GetColumnPathIndexOf({?Year}-3)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-3), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-1), CurrentSummaryIndex))
Difference b/w 15 & 18
if GetColumnPathIndexOf({?Year}-3)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-3), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}), CurrentSummaryIndex))
Difference b/w 16 & 17
if GetColumnPathIndexOf({?Year}-2)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-2), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-1), CurrentSummaryIndex))
Difference b/w 16 & 18
if GetColumnPathIndexOf({?Year}-2)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-2), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}), CurrentSummaryIndex))
Difference b/w 17 & 18
if GetColumnPathIndexOf({?Year}-1)= - 1 then 0 else if {?Year}>0 then -(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}-1), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?Year}), CurrentSummaryIndex))
Many thanks for any hint, much appreciated.
Best Regards,
Hi Anwar,
Right-click the Calculated Column's header cell > Select Calculated Member > Edit Insertion Formula > Use this code:
GetColumnGroupIndexOf(CurrentColumnIndex) = 0
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.