Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I created a composite key with fields as Enterdate &'_'& Centernum as %key and then i drop the field EnterDate,
but i need to use the date field in the front end expression may i know how to fetch only date field from %key.
I tried this ...date(date#(left(%key,10),'MM/DD/YY')
Try this:
Date(Date#(SubField (%key, '_', 1), 'MM/DD/YY'))
Assuming your Enterdate was in the format 'MM/DD/YY'
It depends on how your Enterdate format...
Considering your Enterdate is having MM/DD/YY format, you need to use as below
Date(Date#(Left(%key,8),'MM/DD/YY'))
In case the format is MM/DD/YYYY use below
Date(Date#(Left(%key,10),'MM/DD/YYYY'))
Is your date 8 characters or 10? Match the date format with the number of characters you are trimming with left().
But if you need the date in the front end, why do you drop EnterDate?
Since you are using Left(%Key), it seems that Enterdate might be MM/DD/YYYY. If that is true, you can try this:
Date(Date#(SubField (%key, '_', 1), 'MM/DD/YYYY'))
Hi, But my %key contains fields like this,because of that i didn't get the dates,any suggestions please
Try this in the script:
Date#(SubField(%key, '-', 1), 'MM/DD/YYYY') as Date
Try this as a dimension:
Date#(SubField(%key, '-', 1), 'MM/DD/YYYY')
Try
Date#(KeepChar(%key,'0123456789/'), 'MM/DD/YYYY')
or
Date#(KeepChar(%key,'0123456789/'), 'DD/MM/YYYY')
Hi,
While writing the expression i got nothing actually i am struck at the flower braces which i got error,can you guide me on that
Hi Naresh,
You can not have expressions on the left side of your set analysis like how you are trying to do..
Please take the suggestion of Jonathan and keep your date filed(EnterDate? ) in your base data model so that you could easily filter the data in the front end.
hth
Sasi