Cognos Analytics

 View Only

 Case when statement for price

Mirsad Selimovic's profile image
Mirsad Selimovic posted Fri March 07, 2025 08:20 AM

Hi,

Can someone please help me with a statement?

I have a report where I want to show the B1 Price linked to PGID and the Effective Date. 

If the PGID is not 1 then (or is greater then 1) show me the price that is for PGID 1 and that price needs to be the price at the time of the transaction. So in case below I would want to see the price 43.104 if that PGID is not 1.

Can someone help please?

Sundeep Punyane's profile image
Sundeep Punyane

Hi Mirsad, 

Your table shows PGID as 1 in both cases, Am i understanding correctly? Can you please clarify a bit more on exact requirement

Regards

Sundeep 

Mirsad Selimovic's profile image
Mirsad Selimovic

Hi Sundeep,

The PGID should always be 1 one when it comes to the B1 Price, but it will have multiple PGID's in the table.

What I want to create is if the PGID is not one, then replace that PGID B1 Price with the one that is for PGID 1 at the time of transaction.

If that makes sense. The B1 price will change through time and what I want to do is compare Sell price for any PGID against the B1 Price for PGID 1 and see what the difference is.

Thomas Wolf's profile image
Thomas Wolf

Could you draw a table showing the input columns and one column for expected output? That would help me understanding the question.