Skip to main content

Francophones

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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

Labels (1)
3 Replies
gabriel_kirst
Creator III
Creator III

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

maxgro
MVP
MVP

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
Author

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