Qlik Community

Groupe des Utilisateurs Francophones

Vous êtes francophone? Ce groupe est pour vous. Venez découvrir comment démarrer avec Qlik Sense et QlikView, poser vos questions et partager vos tutos et astuces avec les membres de notre communauté.

Not applicable

Multiple IF imbricated Qlikview

Hi,

I have a big problem with the IF Condition.
I would like to write (translate) this code :

  CASE (D.DOC_TYPE)WHEN 'A' THEN 'Achat'

    WHEN 'V' THEN 'Ventes'

    END AS 'Type de doc.',

       

  CASE (D.DOC_TYPE)

    WHEN 'V'

            THEN

                CASE (D.DOC_STYPE)

                        WHEN 'P' THEN 'Pro-forma'

                        WHEN 'D' THEN 'Devis'

                        WHEN 'C' THEN 'Commandes'

                       WHEN '0' THEN 'Avoirs Financiers'

    END

    WHEN 'A' THEN

        CASE (D.DOC_STYPE)

            WHEN 'D' THEN 'Demandes de Prix'

            WHEN 'C' THEN 'Commandes'

             WHEN 'A' THEN 'Avoirs'

            WHEN '0' THEN 'Avoirs Financiers'

        END

    END AS 'Sous type de doc.',

Someone can help me, please, it's very very urgent!!!!!!

Regards

3 Replies
Highlighted
gabriel_kirst
Contributor III

Re: Multiple IF imbricated Qlikview

You can try this:

if(D.DOC_TYPE = 'A', 'Achat', if(D.DOC_TYPE = 'V', 'Ventes')) as [Type de doc.],

if(D.DOC_TYPE = 'V',

  if(D.DOC_STYPE = 'P', 'Pro-forma',

  if(D.DOC_STYPE = 'D', 'Devis',

  if(D.DOC_STYPE = 'C', 'Commandes',

  if(D.DOC_STYPE = '0', 'Avoirs Financiers')))

  ),

  if(D.DOC_TYPE = 'A',

  if(D.DOC_STYPE = 'D', 'Demandes de Prix',

  if(D.DOC_STYPE = 'C', 'Commandes',

  if(D.DOC_STYPE = 'A', 'Avoirs',

  if(D.DOC_STYPE = '0', 'Avoirs Financiers')))

  )

  )

  ) as [Sous type de doc.],

Regards,

Gabriel

MVP
MVP

Re: Multiple IF imbricated Qlikview

t:

load * inline [

doc_type, doc_stype

V,P

V,D

V,C

V,O

A,D

A,C

A,A

A,O

];

f:

load

  *,

  pick(match(doc_type, 'A', 'V'), 'Achat', 'Ventes') as [Type de doc.],

  if(doc_type='V',  pick(match(doc_stype, 'P', 'D', 'C', 'O'), 'Pro-forma', 'Devis', 'Commandes', 'Avoirs Financiers'),

  if(doc_type='A',  pick(match(doc_stype, 'D', 'C', 'A', 'O'), 'Demandes de Prix', 'Commandes', 'Avoirs', 'Avoirs Financiers')

  )) as [Sous type de doc.]

resident t;

Not applicable

Re: Multiple IF imbricated Qlikview

Thank you for your answer, Mr. Grossi and Mr. Rocha. I'll test them.
But I do not know if you have any answer to this problem ?? :
first Step for Building Dashbord Qlikview (Join, Load, Set, If)


I don't know, where do I start!!!

Thank you again.
Have a nice evening