Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate Year+Month

Hi,

i´d like to create a new dimension,where i can connect two existed dimensions (year/month) and character "/" = for example 2012/5

Could i do it in calculate dimension by some formula,or should i solve it in script by distinct

Thx a lot

J.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

try: year&'/'&month as yearmonth. This will result in a string, so don't try to use date calculations on it. If you need that use something like Rebeca posted. Perhaps date(makedate(year,month),'YYYY/M') will do. Note, qlikview is Case Sensitive, so 'year' is not the same as 'Year'. Take this into account when creating and using field names.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Not applicable
Author

try

DATE (MakeDate(YEAR('YEAR'),MONTH('MONTH')),'YYYY/MM') as DATE_NEW

MayilVahanan

HI

Try like this

=Year &'/'&Month as dimension

or

Load Year&'/'&Month as YearMonth from tablename;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Gysbert_Wassenaar

try: year&'/'&month as yearmonth. This will result in a string, so don't try to use date calculations on it. If you need that use something like Rebeca posted. Perhaps date(makedate(year,month),'YYYY/M') will do. Note, qlikview is Case Sensitive, so 'year' is not the same as 'Year'. Take this into account when creating and using field names.


talk is cheap, supply exceeds demand
CELAMBARASAN
Partner - Champion
Partner - Champion

You can use Calculated dimension as

=YearField&'/'&MonthNumberField

Or in Script

Date(Floor(DateField),'YYYY/M')

Using this in script in better.

Not applicable
Author

Thanks,it works....can you tell me,how i get a legend into a chart,i still have it next chart on the right and i cannot find this way in the options/presentations

Thanks a lot

Gysbert_Wassenaar

There are some settings for the legend on the Presentation tab. Click on Settings in the Legend box. There's also a way to move the legend around a bit. Select your chart and press Ctrl+Shift. You should then see boxes with red outlines. You can move and resize the boxes while you keep the Ctrl+Shift keys down.


talk is cheap, supply exceeds demand
Not applicable
Author

Yes,thanks for a very good advice

J.