Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Format Dimension - Script

Morning

How to format a date from 12.15.2015 to monthyear 12.2015 and a number 12,44567778 to  decimal number 12,45 while loading for using later as dimension?

LOAD

monthyear

decimalnumber

Or how to format dimension?

Is it possible - I searched for solutions but didnt found.

Thank you.

4 Replies
MVP
MVP

Re: Format Dimension - Script

LOAD

     Date(Date#(monthyear, 'MM.DD.YYYY'), 'MM.YYYY') As Date,

     Num(decimalnumber, '0,00', ',') As Number,

     ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: Format Dimension - Script

Date(MonthStart(date#('12.15.2015', 'MM.DD.YYYY')), 'MM.YYYY')

or without MonthStart



round(number, 0.01)



Re: Format Dimension - Script

For date you can use date function and for number use Num() function

Date(DateField, 'MM.YYYY') as DateField,

Num(NumberField, '##.00') as NumberField

Not applicable

Re: Format Dimension - Script

Thank you - I am happy now.

Community Browser