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

Explain the syntax?

Hi,

Can you plz explain this below syntax.

if my date is 12/02/2014 then what will happen using this below syntax.

right(repeat(0,1)&subfield(date(date),'/',1),2)

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

I just explained.

If you date is 5/02/2014.

It will add leading zero. Here o/p will be 05.

Regards

ASHFAQ

View solution in original post

4 Replies
ashfaq_haseeb
Champion III
Champion III

12

If it is 5/02/2014 it will return 05

Regards

ASHFAQ

alexandros17
Partner - Champion III
Partner - Champion III

right(repeat(0,1)&subfield(date(date),'/',1),2)


Transform date to a date format -> date(date)


Then with subfield take the first part of the date : if 7/06/2014 it takes 7


The repeat repeat the char 0 1 time so you have a string 0 concatenated to 7


at the ent it takes only the 2 char to the right

Not applicable
Author

Hi Ashfaq,

What is the use of repeat(0,1) here?

ashfaq_haseeb
Champion III
Champion III

I just explained.

If you date is 5/02/2014.

It will add leading zero. Here o/p will be 05.

Regards

ASHFAQ