Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Case Statements as expressions or veriables in Qlikview

Greetings,

I would like to have a column in a table or chart using either expressions or variable based on the following logic:

   CASE

            WHEN ( PLANNED_FLAG = 'Y'

                  AND REASON_CODE IS NULL

                  AND TYPE_CODE IN ('5', '7')

                  AND STATUS_CODE NOT IN ('5', '7')

                  AND (TARGET_FLAG ='Y' OR TARGET_FLAG IS NULL))

            THEN

               'Y'

            ELSE

               'N'

         END

            AS CALC_COLUMN;

Can you please help.

Thank you,

3 Replies
petter
Partner - Champion III
Partner - Champion III

‌If( PLANNED_FLAG = 'Y'

  AND IsNull(REASON_CODE)

  AND Match(TYPE_CODE,'5','7')

  AND Not(Match(STATUS_CODE,'5','7'))

  AND (TARGET_FLAG='Y' OR IsNull(TARGET_FLAG))

,  'Y'

, 'N') AS CALC_COLUMN

aarkay29
Specialist
Specialist

If(

          PLANNED_FLAG = 'Y'

     AND

           IsNull(REASON_CODE)

     AND

          Match(TYPE_CODE,'5','7')

     AND

          Not Match(STATUS_CODE,'5','7')

    AND

          (TARGET_FLAG='Y' OR IsNull(TARGET_FLAG)),  'Y', 'N') AS CALC_COLUMN

Not applicable
Author

Perfect.

Thank you.