cancel
Showing results for 
Search instead for 
Did you mean: 

Can we bypass a variable for a part of a calculation view?

Former Member
0 Kudos

Hi all,

I have a calculation view (A) which contains a union of 2 other calculation views (B and C).  These 2 are exactly the same, except for one column (FKDAT).

FKDAT exists only in view B.

Now, on view A, we defined 3 variables.  2 of these variables are defined on columns which are present in both views B and C (BUKRS and BUDAT).

A third variable is defined on FKDAT, which is only present in view B.

The behavior of view A is as expected in fact: if I do not enter a selection on FKDAT, I get results from view B and view C.

But as soon as I enter a selection on FKDAT, I only get results from view B, as view C does not have FKDAT.

Is there a way to change this behavior?: if a selection on FKDAT occurs, display all records from view C anyway?

I was thinking about adding a FKDAT-calculated-column in view C, which contains a constant and then always take this constant value in the selection on FKDAT.

But are there other ways?

Accepted Solutions (1)

Accepted Solutions (1)

anindya_bose
Active Contributor
0 Kudos

Hi..

Can you not use an Input Parameter on FKDAT at the projection level of view B itself ? 

One issue you might face if FKDAT is not provided ( as IP in CV needs the value of Input Parameter ) .

IF that is a mandatory parameter, nothing needs to be done, else you can use match operator to take all values when FKDAT would be blank .

Cheers

Anindya

Former Member
0 Kudos

Hi Anindya,

this approach works indeed.

But, thing is with input parameters, that they do not behave as variables.

I would like to be able to enter a range, sames as for variables.

But as far as I know, it's not possible to get this "select-options" functionality on input parameters.

The filtering part however works perfectly as you described.

anindya_bose
Active Contributor
0 Kudos

You are right, I can see Multiple Entries but no Range in IP. I am in SP9.

But range thing can be done with two Input Parameter.  Only problem with IP in CV is, values need to be supplied or you need to take care of the expression to match with * .

Can you not use a join instead of union if your data volume is less ?

Regards

Anindya

Former Member
0 Kudos

The 2 IP approach was also something that crossed my mind.  The match-expression difficulty was handled by setting the IP's mandatory.

However: users found it not intuitive at all: in the variable screen they have to enter 2 dates.

One of those dates is a real HANA variable, so using ranges.

The other are in fact 2 input parameters.

And they found it very confusing/annoying having to enter dates in 2 different ways, which I understand.

So at the moment I'm back at my original solution of creating a constant column in view C and map it in the union.  Like that I can keep using variables instead of IP's.

Maybe in the future there will be range input parameters?  Would be nice 🙂

PS. a join is not possible unfortunately for this model.

anindya_bose
Active Contributor
0 Kudos

What value you are supplying as constant ?

Former Member
0 Kudos

11111111 as it is easy to remember and not used in the database.  Lucky me.

Of course this value has to be added to the selection criteria if they want to filter on this date.

Answers (1)

Answers (1)

thirus11
Participant
0 Kudos

Hi..

Try using UNION with Constant Values. Hope this would help!!

Best Regards,

Thiru

Former Member
0 Kudos

Tnx for the answer, but as you can see in previous posts, that solution was already discussed.