Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $400 before Dec 31st: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
arvind1494
Specialist
Specialist

Dual function

Dual function

Hi All,

Can some one Tell me where can i use Dual function in Scrip

Give me some Example script

1 Solution

Accepted Solutions
kundan_sharma1
Contributor III
Contributor III

Dual() combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes

Syntax:

Dual(text, number)

Load dual ( NameDay,NumDay ) as DayOfWeek inline

[ NameDay,NumDay

Monday,0

Tuesday,1

Wednesday,2

Thursday,3

Friday,4

Saturday,5

Sunday,6 ];

The field DayOfWeek

can be used in a chart, as a dimension, for example.In a table with the week days are automatically sorted into their correct number sequence, instead of alphabetical order.

View solution in original post

3 Replies
kundan_sharma1
Contributor III
Contributor III

Dual() combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes

Syntax:

Dual(text, number)

Load dual ( NameDay,NumDay ) as DayOfWeek inline

[ NameDay,NumDay

Monday,0

Tuesday,1

Wednesday,2

Thursday,3

Friday,4

Saturday,5

Sunday,6 ];

The field DayOfWeek

can be used in a chart, as a dimension, for example.In a table with the week days are automatically sorted into their correct number sequence, instead of alphabetical order.

abhijith862
Contributor III
Contributor III

Refer the Link for the same:

How to use- Dual()

d_ankusha
Creator II
Creator II

The Dual function is used to keep values in order.

For example:

Load Dual(day,number) Inline[

day,number

monday,1

tuesday,4

wednesday,2

];

OUTPUT:

monday

wednesday

tuesday

here you can see that the days are arranged in sorted order based on the number field.