cancel
Showing results for 
Search instead for 
Did you mean: 

Need to use Formula to add a formula

Former Member
0 Kudos

Hello Experts,

In one of the requirement, I wrote a formula to calculate Level from the Hierarchy of a particular Dimension.

Now, I need to prompt user input for the 'Level' and filter the report comparing "Prompt Level" and "Calculated Level". Im getting an error while writing the formula for this "This filed can be only used in a print-time formula".

What can be the reason? Any alternatives for this? Any help appreciated.

Regards,

arjun

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Arjun,

Record Selection formula is processed in Pass 1 whereas formulas that contain fields like 'Record Number' or formulas that start with 'WhilePrintingRecords' are processed in Pass 2. So, you can see why these formulas cannot be used in the selection formula.

If the record selection formula is one that is returning the error, could you please paste the formulas here (All the 3 formulas).

-Abhilash

Former Member
0 Kudos

Hello Abhilash,

Thanks for the info. It really made sense. As you said, the error is coming in record selection formula.

The formulas that I'm using are:

1.To get Hierarchy level : HierarchyLevel(GroupingLevel(<Dimension>))

2. We have a user prompt to get Level input from user

3. In recod Selection, we need to return all records which 'User Input Level' matches with 'Calculated Level'

Please advise whether we have an alternative for this.

Thanks,

arjun

abhilash_kumar
Active Contributor
0 Kudos

Hi Arjun,

Well, HierarchyLevel, GroupingLevel are all Crystal functions and they cannot be used in selection formula to filter the records off. The records will be there so the only thing you can do is suppress the groups.

So let's say the user selects 2 as the Input Level, what do you want the report to show? The groups with HierarchyLevel <2 or =2 or > 2? Whatever the condition is, you should be able to refer the formula in the Suppress condition for the Group.

So, you could perhaps write a suppression formula like this:

HierarchyLevel(GroupingLevel(<Dimension>)) < 2

This will suppress all the groups with HierarchyLevel less than 2.

Hope this helps!

-Abhilash

Former Member
0 Kudos

Hey Abhilash,

Thanks a bunch dude. It indeed solved my problem.

Cheers,

arjun

Former Member
0 Kudos

Hello Abhilash,

Just one more info.

We need to have a Drop down for Level Prompt as I mentioned. Is there any way to make it dynamic by populating the 'Account Level' values as the drop down values.

Thanks in advance,

arjun

Answers (0)