Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem copying pasting formula

I have a problem in Qliksense with copying and pasting a formula. At first it was an old formula for a different data set and it was working just fine. I changed the header of the dataset and therefore had to change my formula. During the adaptation of the formula all of a sudden I couldn't type or past the text I wantend. So I went on to edit the formula in a notepad to paste the entire thing but also then cuts of the paste at some point.

I tested the individual parts of my formula and they seem to be working just fine.

I have no idea where to look for the mistake since the individual parts of the formula works and a copy of the formula with different headers works perfectly fine with the other dataset.

Would anyone know where to look for the solution?

I added the textfile of the formula.

4 Replies
swuehl
MVP
MVP

Well, following isn't handling your problem with editing an expression, this might be due to the length of the expression or number of spaces used or something else, I don't know.

But have you considered simplifying your expression? It seems that you are essentially aggregating some five to six fields, with different filter used in set expression, then summing the resulting values returned from the aggregations.

Maybe you can combine the aggregations of one field by combining the filters in your set analysis

(not sure if this is feasable, might depend on your data and model), like

Sum({<Field = {A}>} Value) +Sum({<Field = {B}>} Value)

turned into

Sum({<Field = {A, B}>} Value)

Anonymous
Not applicable
Author

I ran into a similar issue a while back where my lengthy expression worked inconsistently. Even though this expression with the prior header worked for you, as suggested by swuehl please consider simplifying it a little (eg: see if the +  and - of the sums can be made compact using single set expressions. Also look if there is a need to use a single quote for '0' and '1' when we can use 0 and 1. )

The blank spaces my be good for viewing but use some editor tool to trim them off. In my experience they have caused me issues when copying pasting (as they add to the total length of characters and sometimes results in the expression being truncated)

What was the field name that was changed? In you expression you have lot of fields and they are in camelcase(mix of upper and lower case). It will help to go through them thoroughly to make sure nothing is misspelled.

Not applicable
Author

Thank you both. I simplified the formula conform swuehl's instructions and now it does work. I will try whether I can remove the single quote from my formula as well.

Thanks!

Anonymous
Not applicable
Author

Great! Good to know that your formula now works. If you are happy with the responses and your problem is solved, please mark this thread complete by selecting the correct answer. (whenever you get a chance).