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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What does this script doing?

Hi,

Could anyone can explain me what exactly this script doing. I am getting answer properly but can not getting.

Dual(Year(StaticoDate)&'-Q'&Ceil(Month(StaticoDate)/3),Year(StaticoDate)&Ceil(Month(StaticoDate)/3))

1 Solution

Accepted Solutions
ajsjoshua
Specialist
Specialist

Hi,

If the StaticoDate is 05-05-2000

Dual(Year(StaticoDate)&'-Q'&Ceil(Month(StaticoDate)/3),Year(StaticoDate)&Ceil(Month(StaticoDate)/3))

Dual((2000)&'-Q'&ceil(5/3),2000&Ceil(5/3))

5/3 is 1.66666

ceil(5/3) returns 2  because 2 is the integer that is greater to 1.66666

Dual((2000)&'-Q'&2,2000&2)


Dual function is nothing but stores two values like in text and as well as in number

so if u take an example of dual(month, month_no)

Month     Month_No

Jan          1

Feb          2

Mar          3

then if u write exp like text(dual(month, month_no) it will give you Jan

and if u write like num(dual(month, month_no) it will give you 1

Regards,

Joshua.

View solution in original post

1 Reply
ajsjoshua
Specialist
Specialist

Hi,

If the StaticoDate is 05-05-2000

Dual(Year(StaticoDate)&'-Q'&Ceil(Month(StaticoDate)/3),Year(StaticoDate)&Ceil(Month(StaticoDate)/3))

Dual((2000)&'-Q'&ceil(5/3),2000&Ceil(5/3))

5/3 is 1.66666

ceil(5/3) returns 2  because 2 is the integer that is greater to 1.66666

Dual((2000)&'-Q'&2,2000&2)


Dual function is nothing but stores two values like in text and as well as in number

so if u take an example of dual(month, month_no)

Month     Month_No

Jan          1

Feb          2

Mar          3

then if u write exp like text(dual(month, month_no) it will give you Jan

and if u write like num(dual(month, month_no) it will give you 1

Regards,

Joshua.