Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Casiean
Contributor
Contributor

Split data into two variables

Hello I'm new to Q l i k sense and I just have 2 questions about my table:

 Country       Date                     Value 
 DE            201801                 24.384,81
 DE            201802                 103.462,09 
 DE            201803                 98.516,47 
 DE           201804                  57.460,55 

UK            201805                 81.323,92 

UK           201806                 102.367,62
UK           201807                 39.723,19 
UK           201808                 46.801,51

First question is how can I separate the date format first 4 char should be year and the last two should be month in two separate variables.

And second what is the formula so i could display in a line chart measure data from only that contains DE

Thank you for your time

Labels (1)
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi 

for the date field you can go with 

num(left(Date,4)) as Year,

num(right(Date,2) as Month

for the expression for your chart , 

i wouldn't do it in expression just allowing the user to select the country he want to see 

but if you insist on expression than 

sum(if(Country-'DE',Value))

will do the job 

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi 

for the date field you can go with 

num(left(Date,4)) as Year,

num(right(Date,2) as Month

for the expression for your chart , 

i wouldn't do it in expression just allowing the user to select the country he want to see 

but if you insist on expression than 

sum(if(Country-'DE',Value))

will do the job 

Casiean
Contributor
Contributor
Author

Thank you for the fast reply, I am going to test it