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

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
jonathandienst
Partner - Champion III
Partner - Champion III

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
maxgro
MVP
MVP

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

or without MonthStart



round(number, 0.01)



sunny_talwar

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
Author

Thank you - I am happy now.