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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ray123
Contributor II
Contributor II

Create a calculated field after a Binary Load

Hi Experts, 

I have a (in my view) straight forward question. Although I couldn't find the answer anywhere... 

Q: How can I create a calculated field, after a binary load? 

 

Just Imagine that my code is this: 

  • Binary [lib://DailyManagement - my_test.qvw];

And that it has a dimension, called 'Country' . 

How can I create 'Country_2' which only replaces 1 value (NULL value to the text 'No value')

Many thanks in advance! 

 

 

 

Labels (3)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

After Binary, all the tables will be in memory so you can reference them in a Load statement using the Resident keyword.  So if "Country" is in a table named "Countries" something like:

Left Join(Countries)
LOAD *,  if(len(Country) = 0, 'No Value', Country) as Country2
Resident Countries
;

Or any other kind of Load, NullAsValue, etc.

-Rob

View solution in original post

2 Replies
Frank_Hartmann
Master II
Master II

Maybe like this:

BINARY test.qvw;

SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD.MM.YYYY';
SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
SET FirstWeekDay=0;
SET BrokenWeeks=0;
SET ReferenceDay=4;
SET FirstMonthOfYear=1;
SET CollationLocale='de-DE';
SET MonthNames='Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sep.;Okt.;Nov.;Dez.';
SET LongMonthNames='Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember';
SET DayNames='Mo.;Di.;Mi.;Do.;Fr.;Sa.;So.';
SET LongDayNames='Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag;Sonntag';


NULLASVALUE Country2;
SET NullValue = 'No value';
NoConcatenate
Final:
Load *, Country as Country2 Resident test;DROP table test;
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

After Binary, all the tables will be in memory so you can reference them in a Load statement using the Resident keyword.  So if "Country" is in a table named "Countries" something like:

Left Join(Countries)
LOAD *,  if(len(Country) = 0, 'No Value', Country) as Country2
Resident Countries
;

Or any other kind of Load, NullAsValue, etc.

-Rob