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: 
prabhas277
Creator
Creator

functions

Hi,

left('7/8/2015',Index('7/8/2015','/',-1)-1) this is my function that output is 7/8 .But my requirement is i want only 8.

how we can achive it?

17 Replies
prabhas277
Creator
Creator
Author

Hi,

my aim is by using left and index function how to achive it? for example

left('7/8/2015',Index('7/8/2015','/',1)-1) for the the o/p is 7

now i want get output is 8 how?

settu_periasamy
Master III
Master III

Hi prabhas,

just a suggestion.

appreciate your aim.. but if there is easy function to get the result why do you stick on your aiming function?

Digvijay_Singh

As others rightly mentioned, you cannot achieve 8 from left function it seems. as after Index function calculation it becomes left('7/8/2015',3) so it gives first 3 char from left which is 7/8.

Text Between seems to be the perfect solution as it can give you whatever is available between separators '/', should make more business sense although not sure of your actual objective of using this script.

Thanks,

Digvijay

prabhas277
Creator
Creator
Author

Hi

exactly i am getting output like 7/8..After index function how it becomes left('7/8/2015',3) explain briefly?

Digvijay_Singh

The second parameter Index('7/8/2015','/',2)-1) calculates to 4-1, where 4 is the index of 2nd occurrence of '/'.

MK_QSL
MVP
MVP

=Mid('7/8/2015',Index('7/8/2015','/',1)+1,Index('7/8/2015','/',2)+1-Index('7/8/2015','/',2))

MK_QSL
MVP
MVP

=Right(Left('7/8/2015', Index('7/8/2015','/',2)-1),Index('7/8/2015','/',1)-1)

MK_QSL
MVP
MVP

=Num(Month(Date#('7/8/2015','D/M/YYYY')))