Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
timmy
Partner - Contributor III
Partner - Contributor III

SQL Select and Case

Can somebody help me with this? What am i doing wrong?

Load *;

SQL select mandt anbud typebudget idpost
case

When actor_type.rowno = 1 then 'VALIDCIR'
When actor_type.rowno = 2 then 'VALIDMNB'
When actor_type.rowno = 3 then 'VALIDDR'
When actor_type.rowno = 4 then 'VALIDIF'
When actor_type.rowno = 5 then 'VALIDTUT'
When actor_type.rowno = 6 then 'VALIDCB'
When actor_type.rowno = 7 then 'VALIDPR'
When actor_type.rowno = 8 then 'VALIDCOR'

End as actor_group

case

when actor_type.rowno = 1 then VALIDCIR
when actor_type.rowno = 2 then VALIDMNB
when actor_type.rowno = 3 then VALIDDR
when actor_type.rowno = 4 then VALIDIF
when actor_type.rowno = 5 then VALIDTUT
when actor_type.rowno = 6 then VALIDCB
when actor_type.rowno = 7 then VALIDPR
when actor_type.rowno = 8 then VALIDCOR

end as validated

case

when actor_type.rowno = 1 then VALID_NAMECIR
when actor_type.rowno = 2 then VALID_NAMEMNB
when actor_type.rowno = 3 then VALID_NAMEDR
when actor_type.rowno = 4 then VALID_NAMEIF
when actor_type.rowno = 5 then VALID_NAMETUT
when actor_type.rowno = 6 then VALID_NAMECB
when actor_type.rowno = 7 then VALID_NAMEPR
when actor_type.rowno = 8 then VALID_NAMECOR

end as actor

case

when actor_type.rowno = 1 then VALID_DATECIR
when actor_type.rowno = 2 then VALID_DATEMNB
when actor_type.rowno = 3 then VALID_DATEDR
when actor_type.rowno = 4 then VALID_DATEIF
when actor_type.rowno = 5 then VALID_DATETUT
when actor_type.rowno = 6 then VALID_DATECB
when actor_type.rowno = 7 then VALID_DATEPR
when actor_type.rowno = 8 then VALID_DATECOR

end as validation_date


case

when actor_type.rowno = 2 then COMMENT_DIR
when actor_type.rowno = 4 then COMMENT_IF

when actor_type.rowno = 5 then COMMENT_TUT
when actor_type.rowno = 6 then COMMENT_CAB
when actor_type.rowno = 7 then COMMENT_PAR
when actor_type.rowno = 8 then COMMENT_COR

end as motivation

case

when actor_type.rowno = 2 then COMMENT_DIR_VIEW
when actor_type.rowno = 4 then COMMENT_IF_VIEW
when actor_type.rowno = 5 then COMMENT_TUT_VIEW
when actor_type.rowno = 6 then COMMENT_CAB_VIEW
when actor_type.rowno = 7 then COMMENT_PAR_VIEW
when actor_type.rowno = 8 then COMMENT_COR_VIEW

end as motivation_visible

JUST_OFFICIEL_FR
JUST_OFFICIEL_NL
FICHE_STEP
FLAG_MCR
ERNAM
ERDAT

From ZELABBUDG,

(SQL select rownum rowno from dual connect by level <= 😎 as actor_type ;

1 Reply
Not applicable

Have no Oracle database at hand and have no idea what you are trying to do but I would try to use commas between your columns. Would also drop the "SQL" in the last "SQL select rownum ....."

/Michael