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: 
becki_kain
Contributor III
Contributor III

spaces in data is throwing me off

I have data coming in with "_" in the name, like P_201709 and when i run a calculation like this, in the variables section:

total_sales_volume_tp1=sum({1<[TP]={$(TP1)}>} TOTAL Volume)

the field "Volume" is summed up just fine.

now, when the data field looks like this "2017 Q3", the same calculation is blank.  looking at the raw data, the field "Volume" does have numerical data in it but it seems that any row which has a space in the time period field has no volume to sum up.  i tried this:

=sum({1<[TP]={$("TP1")}>} TOTAL Volume) and that not only didn't solve the problem, it broke all the other rows.  any ideas, please?  thanks

becki kain

1 Solution

Accepted Solutions
Anonymous
Not applicable

You could either create duplicate variables, one with [] and one without  OR

you'd have to do

=prugechar(TP1 &' ' &'Retail Share '&TP2,'[]')

View solution in original post

9 Replies
vishsaggi
Champion III
Champion III

Need more information with some sample data!

becki_kain
Contributor III
Contributor III
Author

excel and qlik enclosed

vishsaggi
Champion III
Champion III

Try single quotes like

= sum({1<[TP]={ '$(TP1)'}>} TOTAL Volume)

Anonymous
Not applicable

change your TP1 variable to

= '[' & Subfield(GetFieldSelections(TP, ','), ',', 1) & ']'

becki_kain
Contributor III
Contributor III
Author

no, that didn't help but thanks.  I tried both single quotes and it didn't help where the spaces were and broke the underscores.  thanks

becki_kain
Contributor III
Contributor III
Author

that works but then what do I do for the caption of the box:

=TP1 &' ' &'Retail Share '&TP2

now TP1 is [2016 Q2] not 2016 Q2 and people are fussy about their captions.  how do I split the [] off, for the caption?  thanks

vishsaggi
Champion III
Champion III

What is your expected output based on the file you enclosed? Can you send us the output you are looking for?

Anonymous
Not applicable

You could either create duplicate variables, one with [] and one without  OR

you'd have to do

=prugechar(TP1 &' ' &'Retail Share '&TP2,'[]')

becki_kain
Contributor III
Contributor III
Author

purgechar!  thanks!  i'm still learning the huge amount of commands there are, for qlik