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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ravikumar_iyana
Creator
Creator

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
sunny_talwar
MVP
MVP

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]

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

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
Creator
Creator
Author

Hi Sunny,

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

Thanks,

Ravi.

sunny_talwar
MVP
MVP

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]