COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: maddycdp on 01 Apr 2012 10:55:30 AM

Title: eqv cognos 8 function for iqd function
Post by: maddycdp on 01 Apr 2012 10:55:30 AM
Hi All,

We are converting old impromptu based iqds into Framework based query subjects. In the part of iqd I have a following case statement. In that I have no clue for pack(  ) function .

Please help me out to find eqv function for pack( ).

Case statement;
CASE WHEN (Table1.Column1 IS NULL) or (Table1.Column1  = 0)
THEN (pack('(OPEN POSITION) - ')) || (upper(Table2."Column2"))
ELSE (pack('Xyz - ' || Table2."column1" || T3."column2"))
END

Thanks in Advance
Maddy
Title: Re: eqv cognos 8 function for iqd function
Post by: cognostechie on 01 Apr 2012 03:27:10 PM
It is hardcoding 'OPEN POSITION -" and 'Xyz -' before concatenating the values from the values depending on whether Table1.Columns1 is null/0 or has a value.

Try If Then Else statement with a similar condition.

I saw your other post also regarding the Date syntax. A good way to understand it would be to see the cube requirements or check the the input Data in Transformer to see what is the format of the Date provided and then do the same in Framework Manager.
Title: Re: eqv cognos 8 function for iqd function
Post by: Mpotla on 01 Apr 2012 06:56:37 PM
Hi ,

Please try the below expressions,

i would prefer you to use the second option, which would give better performance than the first one.

1)
Case statement;
CASE
WHEN (Table1.Column1 IS NULL) or (Table1.Column1  = 0)
THEN (('(OPEN POSITION) - ')) || (upper(Table2."Column2"))
ELSE (('Xyz - ' || Table2."column1" || T3."column2"))
END

2)
Case statement;
CASE
WHEN (Table1.Column1 IS NULL or Table1.Column1  = 0) THEN
(concat('OPEN POSITION) - ', upper(Table2.Column2))
ELSE (concat('Xyz - ' ,concat( Table2.column1 , T3.column2)) )
END


thanks,


Title: eqv cognos 8 function for iqd function
Post by: MFGF on 02 Apr 2012 02:14:29 AM
pack() is a function which converts multiple contiguous spaces in a string to a single space, and does clever stuff like recognising and removing spaces before a comma.

Regards,

MF.


Sent from my iPad using Tapatalk HD
Title: Re: eqv cognos 8 function for iqd function
Post by: blom0344 on 03 Apr 2012 02:56:41 PM
Quote from: Mpotla on 01 Apr 2012 06:56:37 PM
Hi ,

Please try the below expressions,

i would prefer you to use the second option, which would give better performance than the first one.

1)
Case statement;
CASE
WHEN (Table1.Column1 IS NULL) or (Table1.Column1  = 0)
THEN (('(OPEN POSITION) - ')) || (upper(Table2."Column2"))
ELSE (('Xyz - ' || Table2."column1" || T3."column2"))
END

2)
Case statement;
CASE
WHEN (Table1.Column1 IS NULL or Table1.Column1  = 0) THEN
(concat('OPEN POSITION) - ', upper(Table2.Column2))
ELSE (concat('Xyz - ' ,concat( Table2.column1 , T3.column2)) )
END


thanks,

What makes you think performance would differ?