Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a script that outputs txt file and some of the fields are blank and need to have a static value on the output, and was wondering if you can have one piece of code that will replace all blank fields with the static value? so in below example in sub-group all will have a static value and supp-code 959 and p-status to have a static value.
supp-code | com-grp | sub-group | p-status |
959 | 100 | ||
959 | 100 | A | |
1723 | 991 | A | |
91 | 54 | A | |
889 | 242 | A | |
1133 | 104 | A | |
705 | 677 | A |
you can do it in two ways
On the script end
Create Sub-group column as below
if(Len(Sub-group)>0,Sub-group,'Static Value') as Sub-group
Similarly for p-status
if(Len(p-status)>0,p-status,'Static Value') as p-status
On a Straight table or Pivot table (User interface side
you can use it as dimension or expression
if(Len(Sub-group)>0,Sub-group,'Static Value')
Similarly for p-status
if(Len(p-status)>0,p-status,'Static Value')
you can do it in two ways
On the script end
Create Sub-group column as below
if(Len(Sub-group)>0,Sub-group,'Static Value') as Sub-group
Similarly for p-status
if(Len(p-status)>0,p-status,'Static Value') as p-status
On a Straight table or Pivot table (User interface side
you can use it as dimension or expression
if(Len(Sub-group)>0,Sub-group,'Static Value')
Similarly for p-status
if(Len(p-status)>0,p-status,'Static Value')
Do I need to define the code for every field?
Hi @Vegar good to know Qlik's null handling feature.
But I'm wondering this feature only work for null values but not blank values. Sometimes Blanks are not considered as null values in qlikview, for that case len(field) works well.
Good to know, you are awesome @Vegar