Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to format the set analysis code?

How to format the set analysis code?

6 Replies
Anonymous
Not applicable
Author

what kind of formatting are you talking about.

Could you provide some example as to what you are trying to achieve.

Anonymous
Not applicable
Author

Hello,

What do you mean by "format the code"?

Regards

Vincent

Not applicable
Author

As long as it gives you the correct results (interpenetrated correctly by QlikView) can you format the code in the way you find it easy to read and work with. I rarely write set analysis expressions that are of the length or complexity that it requires to split up into multiple rows to be easy to understand. 

Not applicable
Author

Some time set analysis code contains numerous conditions and calculation.

It is better to break and format the code with in editor for better readability

kouroshkarimi
Creator III
Creator III

Format the code in whatever way works for you.

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

If you're using an expression with set analysis inside a text object or any other object that doesn't have the number tab in properties, you can apply format with functions,

for example,

let's suppose you have this expression:

Sum({$<Country={'Mexico'}, Year={ $(=Max(Year) }>} Sales)

if you don't apply any format it will appear with default formatting,

then if you wanted to give some format to the number, you could do this:

num(Sum({$<Country={'Mexico'}, Year={ $(=Max(Year) }>} Sales), '$#,##0.##')


this way the result will be a number with $ symbol, a comma every threee number and two decimals for cents,


regards