Qlik Sense Formatting Functions

Last updated on Nov 15 2021
Deepak Gupta

Table of Contents

Qlik Sense Formatting Functions

i. ApplyCodepage() function in Qlik Sense

We use the applycodepage() function to use the format i.e. the list of a codepage onto a chart expression or another page. We commonly use this function once we want to repeat a particular character from one section of code to a different. In script expressions, we mostly use this function.
Syntax:

1. ApplyCodepage(text, codepage)

Where from the text parameter, you’ll mention the sector or text upon which you would like to use the codepage.
codepage is that the list that’s to be applied on the sector or text.

For instance, we’ve a bit of code, where we would like to use character sets of respective languages to 3 rows. we’ll roll in the hay for every row using the apply code page function.

Do you realize Qlik Sense Null Functions

1. LOAD
2. ApplyCodepage(ROWA,1253) as
3. GreekProduct,
4. ApplyCodepage (ROWB, 1255) as
5. HebrewProduct,
6. ApplyCodepage (ROWC, 65001) as
7. EnglishProduct;
8. SQL SELECT ROWA, ROWB, ROWC From
9. Products;

Thus, this may apply Windows Greek list , that the corresponding number is 1253 to the sector ROWA. Similarly, 1255 and 65001 are the quality UTF-8 character sets for Hebrew and English/Latin respectively which we’ll apply on ROWB and ROWC fields respectively. These three fields are loaded from SQL and aren’t within the required character sets. So, we use this function to use the quality Windows character sets.

ii. Date() function in Qlik Sense

The date() function specifies a date format for a worth or expression within the data load script. Like all the formatting functions, this function also returns value in dual format i.e. both text and numeric interpretations.
Syntax:

1. Date(number[, format])

Where, the amount is that the value that you would like to line the date format.

Using the format parameter, you’ll specify the format of the date alternatively the default formats can assume as saved within the system. There are two sorts of formats that are within the system by default, they are, YY-MM-DD and M/D/YY.

You must read Qlik Sense Logical Functions
Example of using this function during a code,

1. Date( Startday )
where Startday=35648
This expression will return two values, numeric and text for both the default data types. For the YY-MM-DD setting, the date (string) representation would be 97-08-06 and numeric interpretation would be 35648. Similarly, for the M/D/YY format, the string representation is 8/6/97 and numeric representation is 35648.

You can also specify the date format as given within the code below.

1. Date(Joining, ‘DD/MM/YYYY’)

where Joining=35648

Thus, the string representation like this number is 06/08/1997 and therefore the numeric representation is 35648.

iii. Dual() function in Qlik Sense

We use the dual() function, because the name suggests to make both textual (string) and numeric representation of a worth . Like as we saw within the example above, we had a textual representation ‘06/08/1997’ for the numeric value 35648 for one date. Dual values are useful to make because in their case, the textual value is employed for display or representation purposes and therefore the numeric counterpart of that value is employed for storage and calculation purposes.

Have a glance at Qlik Sense Field Functions

Syntax:

1. Dual(text, number)

Where, the text is that the textual value that you simply want to possess a numeric part for and therefore the number parameter is that the numeric value which you would like to use with the string value in an argument.
For instance, within the code given below, we’ve loaded a field named DayOfWeek which contains weekdays both as string representations and have corresponding numbers to the strings. The numerical part is employed in sorting these weekdays numerically and if the weekdays are referred by numbers in another function then these numbers (0 to 6) are often employed by the system’s logic to know which weekday is being mentioned.

1. Load dual ( DayName,DayNumber ) as DayOfWeek inline
2. [ DayName,DayNumber,
3. Monday,0
4. Tuesday,1
5. Wednesday,2
6. Thursday,3
7. Friday,4
8. Saturday,5
9. Sunday,6 ];

iv. Interval() function in Qlik Sense

The interval() function defines an interval format for date and time intervals which are generally utilized in chart expressions and data load scripts. Intervals are often formatted in some ways like as time, as a day, as time and day both which has both, the weather of a date which of your time .

Let’s take a tour to Qlik Sense Numbering Functions

Syntax:

1. Interval(number[, format])

Where number is that the numeric value which you would like to urge formatted as interval.
By mentioning the format, you set the sort of formatting which you would like to use on the amount . If no sort of formatting mentioned, then the default formats are applied like, YY-MM-DD for date and hh:mm:ss for time and variety decimal separator.

For example,

1. Interval( Day )

where Day=0.375

Returns, a string value ’09:00:00’ and a corresponding number 0.375 for this value. Thus, this function return values in dual data formats.

v. Money() function in Qlik Sense

The money() function is employed to format values as representation of cash . The formatting sets are usually taken from the available system variables within the data load script or within the OS . If you would like to use the other money format on the values, you would like to specify them within the expression with valid decimal and thousands separator.

You must read Qlik Sense integer Functions

Syntax:

1. Money(number[, format[, dec_sep[, thou_sep]]])

Where, number is that the value which must be formatted as money.

Format is that the specific format which is system defined or mentioned by the user. If you are doing not specify a format during this function, then the formats saved within the system as defaults are haunted . There are two sorts of money formats which are available within the system, first is kr ##0,00, MoneyThousandSep’ ‘ and therefore the second is $ #,##0.00, MoneyThousandSep’,’.

dec_sep is that the string which specifies the decimal number separator.

thou_sep is that the string which specifies the thousands number separator.

For example, suppose we mention the cash format for values within the variable, amount.

1. Money( Amount, ‘#,##0 $’, ‘.’ , ‘,’ )

where Amount=3564800
It will return a string representation as 3,564,800 $ and variety which is 3564800.

vi. Num() function in Qlik Sense

This function formats values as numbers. during this function, you’ll specify the format for variety or use the pre-defined formatting set provided by the system. This function also returns a dual format value.

Do you realize Qlik Sense Scatter Plot

Syntax:

1. Num(number[, format[, dec_sep [, thou_sep]]])

Where, number is that the value which must be formatted as money.

Format is that the specific format which is system defined or mentioned by the user. If you are doing not specify a format during this function, then the date formats saved within the system as defaults are used.

dec_sep is that the string which specifies the decimal number separator. MoneyDecimalSep is employed because the default decimal separator.

thou_sep is that the string which specifies the thousands number separator. MoneyThousandSep is employed because the default thousand separator within the data load script.

For example, within the piece of code given below, we’ve set a format for the numeric values as 0.00.

1. Sheet1:
2. let result= Num( pi( ), ‘0.00’ );
3. Load * inline
4. [Field1; Field2
5. 4; 12.56
6. 1; $(result)
7. ](delimiter is ‘;’);

The results for the sector Field1 are going to be 4 and 1. Results for the sector Field2 are going to be 12.56 and 3.14 (value of pi) consistent with the format laid out in the function.

vii. Time() function in Qlik Sense

The time() function returns a numeric value by formatting it as a value . The default settings are hh:mm:ss within the system which is haunted if you are doing not specify a time format within the function expression.

Let’s revise Qlik Sense Date and Time Functions

Syntax:

1. Time(number[, format])

Where, number is that the value upon which you would like to use the time format. And using the format parameter, you’ll specify the format during which you would like time to urge displayed.

For example, you’ll assign the time format to the values within the variables.

1. Time( T )

where T=0.375

Returns a string value like the numeric value for T= 0.375 which is 09:00:00 as time.

viii. Timestamp() function in Qlik Sense

This function formats a numeric value as a date and time timestamp. the worth returns in dual format i.e. it interpret both as a string and numeric value.

Syntax:

1. Timestamp(number[, format])

Where, number is that the numeric value which is to be formatted as a timestamp
Take a visit to Qlik Sense Mapping Functions

format is that the specific format which you would like to use on the worth to form it a timestamp. There are two sorts of formats i.e. YY-MM-DD hh:mm:ss and M/D/YY hh:mm:ss which are available within the system as default formats. you employ these if you are doing not specify a format for timestamp.

For example,

1. Timestamp(TS)

where TS=35648.375

This will return two values, for every of the 2 default timestamp format. For YY-MM-DD hh:mm:ss format the result’s , 97-08-06 09:00:00 (string) and 35648.375 (numeric). And for M/D/YY hh:mm:ss format the result’s 8/6/97 09:00:00 (string) and 35648.375 (numeric).

So, this brings us to the end of blog. This Tecklearn ‘Qlik Sense Formatting Functions’ blog helps you with commonly asked questions if you are looking out for a job in Qlik Sense BI. If you wish to learn Qlik Sense and build a career in Business Intelligence domain, then check out our interactive, Qlik Sense Certification Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Qlik Sense Certification Training

Qlik Sense Certification Training

About the Course

Qlik Sense is a revolutionary Business Analytics tool to come from the Qlik stables. It provides powerful self-service analytics that are readily deployable through interactive and personalized dashboards, data visualization techniques and insightful reports. By the end of this Qlik Sense online training, you will be able to perform key skills of the self-service BI tool – Qlik Sense, such as self-service analytics, write data load scripts, data discovery, create dashboards, develop and share apps, create reports, and design and build data visualizations. All these skills will enable you to clear the Qlik Sense certification exam.

Why should you take Qlik Sense Training?

• The average annual pay for a Qlik Sense Professional is $101,871. -Indeed.com.
• HSBC, Alstom, Chrysler, Citibank, Accenture and many other MNC’s worldwide use Qlik Sense BI and it has a market share of around 5% globally.
• By the end of 2020, the market is expected to touch USD 22.8 billion as modern BI and analytics continue to expand more rapidly, Gartner said in a report.

What you will Learn in this Course?

Introduction and Installation of Qlik Sense

• Need for self-service Business Intelligence/Business Analytics
• Installation of Qlik Sense and Qlik Sense Desktop

Qlik Sense Features

• Qlik Data indexing engine
• Data dimensions relationships
• Types of Data Loading
• Types of Concatenation

Data Modelling

• Qlik Sense data architecture
• Understanding QVD layer
• Converting QlikView files to Qlik Sense files
• Incremental Load
• Scripting
• Create Master Calendar

Advance Data Modelling

• Qualify and unqualify
• Joins
• Keep
• Cross Table
• Let Vs Set
• Calendar Table Creation

Qlik Sense Enterprise

• Various Functions
• Create QVD Files
• Read Data for QVD Files
• Create QVD’s
• Create Tier 2 Qlik Sense App

Data Visualization

• Expressions
• Variables
• Extensions
• Data Visualization

Set Analysis

• Set analysis in Qlik Sense
• Use set expression like identifiers, operators, modifiers and comparative analysis

Advance Set Analysis

• Deploy comparison sets and perform point-in-time analysis

Qlik Sense Storytelling

• Storytelling feature of Qlik Sense
• Create a story and playback the story

Qlik Sense Visualization

• Qlik Sense Charts
• Advanced Charts
• Creating Dashboards
• Real Life Examples

Security

• Security aspects of Qlik Sense
• Security rules

Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "Qlik Sense Formatting Functions"

Leave a Message

Your email address will not be published. Required fields are marked *