Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ravikumar_iyana
Contributor

Required expression

Hi Community,

I have an requirement:

  1. I have fields OPU, Draft 1, Draft 2, Draft 3.
  2. based on this 4 fields , want do describe 5 th field "Required Result".
  3. comparing to OPU , NULL Draft number requiredd to display.
  4. I want to require a expression .
  5. when two fields null then those both fields required to display

    

OPUDraft 1Draft 2Draft 3Required Result
ABC14 01 201505 01 201520 06 2015Null
PPTSB10 03 2017-15 04 2017Draft2
VPSB20 04 201725 05 2017-Draft3
PLMMSB17 07 2017-25 08 2017Draft2
PMTSB-10 04 201702 04 2017Draft1
VSKP--04 02 2018Draft 1 & Draft 2

Thanks,

Ravi.

1 Solution

Accepted Solutions

Re: Required expression

May be this

If(Len(Trim([Draft 1])) = 0,

     If(Len(Trim([Draft 2])) = 0,

          If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft2 & Draft3', 'Draft1 & Draft2'),

     If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft3', 'Draft1'),

     If(Len(Trim([Draft 2])) = 0,

          If(Len(Trim([Draft 3])) = 0, 'Draft2 & Draft3', 'Draft2'),

          If(Len(Trim([Draft 3])) = 0, 'Draft3', 'Null'))) as [Required Result]

3 Replies

Re: Required expression

Only one of the Drafts can ever be null? If that is true, then may be this

If(Len(Trim([Draft 1])) = 0, 'Draft1',

     If(Len(Trim([Draft 2])) = 0, 'Draft2',

          If(Len(Trim([Draft 3])) = 0, 'Draft3', 'Null'))) as [Required Result]

ravikumar_iyana
Contributor

Re: Required expression

Hi Sunny,

when Draft 1 , Draft 2 both null means required Result: Draft 1 & Draft 2

Thanks,

Ravi.

Re: Required expression

May be this

If(Len(Trim([Draft 1])) = 0,

     If(Len(Trim([Draft 2])) = 0,

          If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft2 & Draft3', 'Draft1 & Draft2'),

     If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft3', 'Draft1'),

     If(Len(Trim([Draft 2])) = 0,

          If(Len(Trim([Draft 3])) = 0, 'Draft2 & Draft3', 'Draft2'),

          If(Len(Trim([Draft 3])) = 0, 'Draft3', 'Null'))) as [Required Result]

Community Browser